[TIP] Building a unittest.TestCase from a doctest

Titus Brown titus at caltech.edu
Tue Dec 18 11:56:31 PST 2007


-> > I thought nose was a test runner for unittest. I guess not.
-> 
-> nose runs unittest tests, and doctests and py.test-style test
-> functions and classes, and other kinds via non-built-in plugins. I
-> think Titus is just saying that he likes to write test functions like:
-> 
-> def test():
->     pass
-> 
-> and let nose figure out how to make them into unittest.TestCases,
-> rather than writing the TestCases himself. More or less?

Yep.  Plus, by using a test runner, I don't need to write those awkward
__main__ unittest magic gimmick code fragments, either ;).

--titus




More information about the testing-in-python mailing list