diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-09-13 21:52:46 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-09-13 21:52:46 (GMT) |
commit | 1d7c8c9a00f57df32b6b5c055b3e5a2d11ed1f05 (patch) | |
tree | 0ebe2bdf0770df715078792f5d4b0ff9fb3b956e /Lib/unittest | |
parent | 87456e53a8f399482c29ef07cbfecaa5a84e2413 (diff) | |
download | cpython-1d7c8c9a00f57df32b6b5c055b3e5a2d11ed1f05.zip cpython-1d7c8c9a00f57df32b6b5c055b3e5a2d11ed1f05.tar.gz cpython-1d7c8c9a00f57df32b6b5c055b3e5a2d11ed1f05.tar.bz2 |
Issue #19013: add unittest.main() epilogs to unittest's own test modules
Diffstat (limited to 'Lib/unittest')
-rw-r--r-- | Lib/unittest/test/test_assertions.py | 4 | ||||
-rw-r--r-- | Lib/unittest/test/test_break.py | 4 | ||||
-rw-r--r-- | Lib/unittest/test/test_case.py | 4 | ||||
-rw-r--r-- | Lib/unittest/test/test_functiontestcase.py | 4 | ||||
-rw-r--r-- | Lib/unittest/test/test_loader.py | 4 | ||||
-rw-r--r-- | Lib/unittest/test/test_runner.py | 4 | ||||
-rw-r--r-- | Lib/unittest/test/test_setups.py | 1 | ||||
-rw-r--r-- | Lib/unittest/test/test_skipping.py | 4 |
8 files changed, 29 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_assertions.py b/Lib/unittest/test/test_assertions.py index 7931cad..af08d5a 100644 --- a/Lib/unittest/test/test_assertions.py +++ b/Lib/unittest/test/test_assertions.py @@ -361,3 +361,7 @@ class TestLongMessage(unittest.TestCase): ['^"regex" does not match "foo"$', '^oops$', '^"regex" does not match "foo"$', '^"regex" does not match "foo" : oops$']) + + +if __name__ == "__main__": + unittest.main() diff --git a/Lib/unittest/test/test_break.py b/Lib/unittest/test/test_break.py index 75532f4..0bf1a22 100644 --- a/Lib/unittest/test/test_break.py +++ b/Lib/unittest/test/test_break.py @@ -282,3 +282,7 @@ class TestBreakSignalIgnored(TestBreak): "if threads have been used") class TestBreakSignalDefault(TestBreak): int_handler = signal.SIG_DFL + + +if __name__ == "__main__": + unittest.main() diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py index 4987250..51b06bc 100644 --- a/Lib/unittest/test/test_case.py +++ b/Lib/unittest/test/test_case.py @@ -1405,3 +1405,7 @@ test case with support.disable_gc(): del case self.assertFalse(wr()) + + +if __name__ == "__main__": + unittest.main() diff --git a/Lib/unittest/test/test_functiontestcase.py b/Lib/unittest/test/test_functiontestcase.py index 9ce5ee3..d7fe07a 100644 --- a/Lib/unittest/test/test_functiontestcase.py +++ b/Lib/unittest/test/test_functiontestcase.py @@ -142,3 +142,7 @@ class Test_FunctionTestCase(unittest.TestCase): test = unittest.FunctionTestCase(lambda: None, description=desc) self.assertEqual(test.shortDescription(), "this tests foo") + + +if __name__ == "__main__": + unittest.main() diff --git a/Lib/unittest/test/test_loader.py b/Lib/unittest/test/test_loader.py index f1f8ecd..b1782a2 100644 --- a/Lib/unittest/test/test_loader.py +++ b/Lib/unittest/test/test_loader.py @@ -1306,3 +1306,7 @@ class Test_TestLoader(unittest.TestCase): def test_suiteClass__default_value(self): loader = unittest.TestLoader() self.assertTrue(loader.suiteClass is unittest.TestSuite) + + +if __name__ == "__main__": + unittest.main() diff --git a/Lib/unittest/test/test_runner.py b/Lib/unittest/test/test_runner.py index 5a91f1b..ef1c1af9 100644 --- a/Lib/unittest/test/test_runner.py +++ b/Lib/unittest/test/test_runner.py @@ -339,3 +339,7 @@ class Test_TextTestRunner(unittest.TestCase): f = io.StringIO() runner = unittest.TextTestRunner(f) self.assertTrue(runner.stream.stream is f) + + +if __name__ == "__main__": + unittest.main() diff --git a/Lib/unittest/test/test_setups.py b/Lib/unittest/test/test_setups.py index bcd69a8..392f95e 100644 --- a/Lib/unittest/test/test_setups.py +++ b/Lib/unittest/test/test_setups.py @@ -501,5 +501,6 @@ class TestSetups(unittest.TestCase): with self.assertRaisesRegex(Exception, msg): suite.debug() + if __name__ == '__main__': unittest.main() diff --git a/Lib/unittest/test/test_skipping.py b/Lib/unittest/test/test_skipping.py index 3556932..e18caa4 100644 --- a/Lib/unittest/test/test_skipping.py +++ b/Lib/unittest/test/test_skipping.py @@ -221,3 +221,7 @@ class Test_TestSkipping(unittest.TestCase): suite = unittest.TestSuite([test]) suite.run(result) self.assertEqual(result.skipped, [(test, "testing")]) + + +if __name__ == "__main__": + unittest.main() |