diff options
Diffstat (limited to 'Lib/unittest/test/test_setups.py')
-rw-r--r-- | Lib/unittest/test/test_setups.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/unittest/test/test_setups.py b/Lib/unittest/test/test_setups.py index b8d5aa4..bcd69a8 100644 --- a/Lib/unittest/test/test_setups.py +++ b/Lib/unittest/test/test_setups.py @@ -494,12 +494,10 @@ class TestSetups(unittest.TestCase): Test.__module__ = 'Module' sys.modules['Module'] = Module - _suite = unittest.defaultTestLoader.loadTestsFromTestCase(Test) - suite = unittest.TestSuite() - suite.addTest(_suite) - messages = ('setUpModule', 'tearDownModule', 'setUpClass', 'tearDownClass', 'test_something') for phase, msg in enumerate(messages): + _suite = unittest.defaultTestLoader.loadTestsFromTestCase(Test) + suite = unittest.TestSuite([_suite]) with self.assertRaisesRegex(Exception, msg): suite.debug() |