mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
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:
parent
dea59cf88a
commit
664448d81f
7 changed files with 76 additions and 65 deletions
|
@ -58,8 +58,8 @@ class Test_FunctionTestCase(unittest.TestCase):
|
|||
def tearDown():
|
||||
events.append('tearDown')
|
||||
|
||||
expected = ['startTest', 'setUp', 'test', 'tearDown',
|
||||
'addError', 'stopTest']
|
||||
expected = ['startTest', 'setUp', 'test',
|
||||
'addError', 'tearDown', 'stopTest']
|
||||
unittest.FunctionTestCase(test, setUp, tearDown).run(result)
|
||||
self.assertEqual(events, expected)
|
||||
|
||||
|
@ -84,8 +84,8 @@ class Test_FunctionTestCase(unittest.TestCase):
|
|||
def tearDown():
|
||||
events.append('tearDown')
|
||||
|
||||
expected = ['startTest', 'setUp', 'test', 'tearDown',
|
||||
'addFailure', 'stopTest']
|
||||
expected = ['startTest', 'setUp', 'test',
|
||||
'addFailure', 'tearDown', 'stopTest']
|
||||
unittest.FunctionTestCase(test, setUp, tearDown).run(result)
|
||||
self.assertEqual(events, expected)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue