summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-07-16 02:59:32 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-07-16 02:59:32 (GMT)
commit21d9987cb5bf49c80aee083b3d6b9e9811ca180c (patch)
treeda54af939edf7d1e5e9c8adf07eca9e8b31ae500
parent5f4e8ca3767db1b9e2b783d0dacf15ea1fbf0589 (diff)
downloadcpython-21d9987cb5bf49c80aee083b3d6b9e9811ca180c.zip
cpython-21d9987cb5bf49c80aee083b3d6b9e9811ca180c.tar.gz
cpython-21d9987cb5bf49c80aee083b3d6b9e9811ca180c.tar.bz2
run_unittest() to support TestCase instances as well as classes. Helps with doctests.
-rw-r--r--Lib/test/test_support.py5
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: