summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-12-19 04:07:28 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-12-19 04:07:28 (GMT)
commitcca5be2e4c5b1a45f42e63e9b1a0a6c6a6647876 (patch)
tree6c211a07c8a1bc4eb34a22f011e539b71724087a /Lib/unittest/test
parentf100dbd6009e18bb1ab14fa6da8732751b1a9add (diff)
downloadcpython-cca5be2e4c5b1a45f42e63e9b1a0a6c6a6647876.zip
cpython-cca5be2e4c5b1a45f42e63e9b1a0a6c6a6647876.tar.gz
cpython-cca5be2e4c5b1a45f42e63e9b1a0a6c6a6647876.tar.bz2
Improvement to fix for issue 9926 to allow TestResult to be reused.
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r--Lib/unittest/test/test_suite.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/unittest/test/test_suite.py b/Lib/unittest/test/test_suite.py
index fa32247..2db978d 100644
--- a/Lib/unittest/test/test_suite.py
+++ b/Lib/unittest/test/test_suite.py
@@ -353,11 +353,16 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
unittest.TestSuite.__call__(self, *args, **kw)
suite = MySuite()
+ result = unittest.TestResult()
wrapper = unittest.TestSuite()
wrapper.addTest(suite)
- wrapper(unittest.TestResult())
+ wrapper(result)
self.assertTrue(suite.called)
+ # reusing results should be permitted even if abominable
+ self.assertFalse(result._testRunEntered)
+
+
if __name__ == '__main__':
unittest.main()