diff options
Diffstat (limited to 'Lib/unittest/test/test_setups.py')
-rw-r--r-- | Lib/unittest/test/test_setups.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/unittest/test/test_setups.py b/Lib/unittest/test/test_setups.py index b8d5aa41e9..392f95efc0 100644 --- a/Lib/unittest/test/test_setups.py +++ b/Lib/unittest/test/test_setups.py @@ -494,14 +494,13 @@ 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() + if __name__ == '__main__': unittest.main() |