[TIP] Building a unittest.TestCase from a doctest
titus at caltech.edu
Tue Dec 18 10:48:31 PST 2007
-> >In my situation, I would like to load doctests from
-> >/over/there/module.py into a file 'test.py' that is loaded with other
-> >unittest.TestCases, and have the doctest run together with the other
-> >test cases.
-> A module may contain multiple tests. I don't understand why you would
-> want a single test case? This would be like taking any test suite and
-> saying you want to treat it as a single test case. I must be
-> misunderstanding you.
no, you understand me right.
My real goal is to get the tests to *run* under the aegis of a different
module; I'm not really all that exercised about *how*.
I spent 15 minutes last night trying to understand unittest well enough
to import the various test cases in a doctest suite into a unittest, but
no joy ;(. I just don't understand the unittest magic very well, I'm
afraid. While I understand the distinction between a TestCase and a
TestSuite, I can't understand why my unittest.TestCases run multiple
(There's a reason I use nose: I've never understood unittest.)
More information about the testing-in-python