mirror of https://github.com/python/cpython
Issue #19013: add unittest.main() epilogs to unittest's own test modules
This commit is contained in:
parent
87456e53a8
commit
1d7c8c9a00
|
@ -361,3 +361,7 @@ class TestLongMessage(unittest.TestCase):
|
||||||
['^"regex" does not match "foo"$', '^oops$',
|
['^"regex" does not match "foo"$', '^oops$',
|
||||||
'^"regex" does not match "foo"$',
|
'^"regex" does not match "foo"$',
|
||||||
'^"regex" does not match "foo" : oops$'])
|
'^"regex" does not match "foo" : oops$'])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
|
|
|
@ -282,3 +282,7 @@ class TestBreakSignalIgnored(TestBreak):
|
||||||
"if threads have been used")
|
"if threads have been used")
|
||||||
class TestBreakSignalDefault(TestBreak):
|
class TestBreakSignalDefault(TestBreak):
|
||||||
int_handler = signal.SIG_DFL
|
int_handler = signal.SIG_DFL
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
|
|
|
@ -1405,3 +1405,7 @@ test case
|
||||||
with support.disable_gc():
|
with support.disable_gc():
|
||||||
del case
|
del case
|
||||||
self.assertFalse(wr())
|
self.assertFalse(wr())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
|
|
|
@ -142,3 +142,7 @@ class Test_FunctionTestCase(unittest.TestCase):
|
||||||
test = unittest.FunctionTestCase(lambda: None, description=desc)
|
test = unittest.FunctionTestCase(lambda: None, description=desc)
|
||||||
|
|
||||||
self.assertEqual(test.shortDescription(), "this tests foo")
|
self.assertEqual(test.shortDescription(), "this tests foo")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
|
|
|
@ -1306,3 +1306,7 @@ class Test_TestLoader(unittest.TestCase):
|
||||||
def test_suiteClass__default_value(self):
|
def test_suiteClass__default_value(self):
|
||||||
loader = unittest.TestLoader()
|
loader = unittest.TestLoader()
|
||||||
self.assertTrue(loader.suiteClass is unittest.TestSuite)
|
self.assertTrue(loader.suiteClass is unittest.TestSuite)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
|
|
|
@ -339,3 +339,7 @@ class Test_TextTestRunner(unittest.TestCase):
|
||||||
f = io.StringIO()
|
f = io.StringIO()
|
||||||
runner = unittest.TextTestRunner(f)
|
runner = unittest.TextTestRunner(f)
|
||||||
self.assertTrue(runner.stream.stream is f)
|
self.assertTrue(runner.stream.stream is f)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
|
|
|
@ -501,5 +501,6 @@ class TestSetups(unittest.TestCase):
|
||||||
with self.assertRaisesRegex(Exception, msg):
|
with self.assertRaisesRegex(Exception, msg):
|
||||||
suite.debug()
|
suite.debug()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
@ -221,3 +221,7 @@ class Test_TestSkipping(unittest.TestCase):
|
||||||
suite = unittest.TestSuite([test])
|
suite = unittest.TestSuite([test])
|
||||||
suite.run(result)
|
suite.run(result)
|
||||||
self.assertEqual(result.skipped, [(test, "testing")])
|
self.assertEqual(result.skipped, [(test, "testing")])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue