[TIP] unittest2 discovery / doctest integration?
Pete
pfein at pobox.com
Wed Apr 28 14:53:56 PDT 2010
On Apr 28, 2010, at 4:26 PM, Pete wrote:
> Appears the way to do this goes like so. In your mostly-unittests test module, define a load_tests:
>
> def load_tests(loader, tests, ignore):
> tests.addTests(doctest.DocTestSuite(module_with_doctests))
> return tests
>
> Pretty straightforward, though not at all obvious. Looks like the documentation for doctest could use an update... http://docs.python.org/dev/library/doctest.html#unittest-api I'd write a patch (hello-to-my-friend-jesse-noller), but I'm not entirely sure what to say (tl;dr) - would replacing the code sample & changing its description to read "To integrate with unittest discovery, include the following in a module of unittests:" suffice?
I just went ahead and created bug 8564 w/ a patch if anyone cares. Thanks all.
--Pete
More information about the testing-in-python
mailing list