bpo-30856: Update TestResult early, without buffering in _Outcome (GH-28180)

TestResult methods addFailure(), addError(), addSkip() and
addSubTest() are now called immediately after raising an exception
in test or finishing a subtest.  Previously they were called only
after finishing the test clean up.
This commit is contained in:
Serhiy Storchaka 2021-09-19 15:24:38 +03:00 committed by GitHub
parent dea59cf88a
commit 664448d81f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 76 additions and 65 deletions

View file

@ -197,7 +197,7 @@ class Test_TestSkipping(unittest.TestCase):
result = LoggingResult(events)
test = Foo("test_skip_me")
self.assertIs(test.run(result), result)
self.assertEqual(events, ['startTest', 'addSkip', 'addFailure', 'stopTest'])
self.assertEqual(events, ['startTest', 'addFailure', 'addSkip', 'stopTest'])
self.assertEqual(result.skipped, [(test, "skip")])
def test_skipping_and_fail_in_cleanup(self):