Skip to content

Commit

Permalink
run_unittest() to support TestCase instances as well as classes. Help…
Browse files Browse the repository at this point in the history
…s with doctests.
  • Loading branch information
rhettinger committed Jul 16, 2003
1 parent 5f4e8ca commit 21d9987
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/test/test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 21d9987

Please sign in to comment.