diff options
-rw-r--r-- | Lib/unittest/suite.py | 1 | ||||
-rw-r--r-- | Lib/unittest/test/test_suite.py | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Lib/unittest/suite.py b/Lib/unittest/suite.py index 73f0e17..77ce089 100644 --- a/Lib/unittest/suite.py +++ b/Lib/unittest/suite.py @@ -104,6 +104,7 @@ class TestSuite(BaseTestSuite): if topLevel: self._tearDownPreviousClass(None, result) self._handleModuleTearDown(result) + result._testRunEntered = False return result def debug(self): 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() |