Commit 21d9987c authored by Raymond Hettinger's avatar Raymond Hettinger

run_unittest() to support TestCase instances as well as classes. Helps with doctests.

parent 5f4e8ca3
......@@ -251,7 +251,10 @@ def run_unittest(*classes):
"""Run tests from unittest.TestCase-derived classes."""
suite = unittest.TestSuite()
for cls in classes:
suite.addTest(unittest.makeSuite(cls))
if isinstance(cls, unittest.TestCase):
suite.addTest(cls)
else:
suite.addTest(unittest.makeSuite(cls))
if len(classes)==1:
testclass = classes[0]
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment