On Dec 25, 2010, at 8:37 PM, Jelmer Vernooij wrote: > > Hi, > > As you might've seen I fixed an error earlier today in the tutorial. I > assumed the tutorial was always run, but that doesn't appear to be the > case: nosetests doesn't run doctests by default.
Nope, never has, mostly because some people have non-doctest interpreter excerpts in docstrings as examples, and then they'd get mysteriously failing tests. > > There is an option to enable the running of doctests, but with that the > setup/teardown function for the doctests as we specify them in > our tutorial_test_suite() function don't get used. Is anybody aware of > a way to get nose to use a test-suite function? I briefly looked over > the documentation but couldn't find anything. Not that I can think of offhand. I can ask the author of Nose if you want (he's a friend), but I think the usual way of doing this is to explicitly call setup/teardown in your doctest. Note that I think that's the usual way even with unittest and friends. Alternatively, we can probably hook up enough of the doctest plumbing in a real test method, but I think I'd rather be able to write small doctests when it makes sense. > With the wider availability of python 2.7 - which includes a SkipTest > class - I would also like to support using the standard Python > test runner. If python 2.4, 2.5 or 2.6 is in use we can > fallback to an alternative such as testtools.run, twisted.trial.run > or unittest2. IIRC, unittest2 comes with a discovery-based testrunner that's got most of the features of nose. Is that available in Python 2.7? > The attached patch changes the Makefile to use unittest's test runner if it is > recent enough and otherwise fall back to testtools. > > Is anybody particularly attached to nose for some reason? Other thoughts? Well, I use nose on a *ton* of projects, many of them not mine, and I've literally never heard of testtools until this email. That alone seems like a nice reason to prefer nose over testtools (I'd be resistant to testtools, given that it doesn't seem to have a ton of mindshare) Nose also comes with the SkipTest functionality we need on older Pythons. If you're really opposed to nose for some reason and are going to require a 3rd party installable anyway, why not unittest2? It's the backport of 2.7's testing system anyway, so nobody should particularly mind. That, or we can put together something that's not discovery-based at all. We've got that set up for hgsubversion, but I still use nose anyway because it adds so many nice features on top of unittest. > > Cheers, > > Jelmer > <dulwich-unittest.run.diff>_______________________________________________ > Mailing list: https://launchpad.net/~dulwich-users > Post to : [email protected] > Unsubscribe : https://launchpad.net/~dulwich-users > More help : https://help.launchpad.net/ListHelp _______________________________________________ Mailing list: https://launchpad.net/~dulwich-users Post to : [email protected] Unsubscribe : https://launchpad.net/~dulwich-users More help : https://help.launchpad.net/ListHelp

