diff options
author | Raymond Hettinger <python@rcn.com> | 2003-07-16 02:59:32 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-07-16 02:59:32 (GMT) |
commit | 21d9987cb5bf49c80aee083b3d6b9e9811ca180c (patch) | |
tree | da54af939edf7d1e5e9c8adf07eca9e8b31ae500 /Lib/test | |
parent | 5f4e8ca3767db1b9e2b783d0dacf15ea1fbf0589 (diff) | |
download | cpython-21d9987cb5bf49c80aee083b3d6b9e9811ca180c.zip cpython-21d9987cb5bf49c80aee083b3d6b9e9811ca180c.tar.gz cpython-21d9987cb5bf49c80aee083b3d6b9e9811ca180c.tar.bz2 |
run_unittest() to support TestCase instances as well as classes. Helps with doctests.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_support.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 005e847..0eb74c2 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -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: |