mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
Fix issue with nested test suites debug method and module setups. (unittest)
This commit is contained in:
parent
83d3576ab8
commit
33958b87f2
2 changed files with 4 additions and 2 deletions
|
@ -112,7 +112,7 @@ class TestSuite(BaseTestSuite):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if hasattr(test, '_wrapped_run'):
|
if hasattr(test, '_wrapped_run'):
|
||||||
test._wrapped_run(result)
|
test._wrapped_run(result, debug)
|
||||||
elif not debug:
|
elif not debug:
|
||||||
test(result)
|
test(result)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -495,7 +495,9 @@ class TestSetups(unittest.TestCase):
|
||||||
Test.__module__ = 'Module'
|
Test.__module__ = 'Module'
|
||||||
sys.modules['Module'] = Module
|
sys.modules['Module'] = Module
|
||||||
|
|
||||||
suite = unittest.defaultTestLoader.loadTestsFromTestCase(Test)
|
_suite = unittest.defaultTestLoader.loadTestsFromTestCase(Test)
|
||||||
|
suite = unittest.TestSuite()
|
||||||
|
suite.addTest(_suite)
|
||||||
|
|
||||||
messages = ('setUpModule', 'tearDownModule', 'setUpClass', 'tearDownClass', 'test_something')
|
messages = ('setUpModule', 'tearDownModule', 'setUpClass', 'tearDownClass', 'test_something')
|
||||||
for phase, msg in enumerate(messages):
|
for phase, msg in enumerate(messages):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue