MCPcopy Index your code
hub / github.com/python/cpython / test_rerun_setup_hook_failure

Method test_rerun_setup_hook_failure

Lib/test/test_regrtest.py:1689–1709  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1687 stats=2)
1688
1689 def test_rerun_setup_hook_failure(self):
1690 # FAILURE then FAILURE
1691 code = textwrap.dedent("""
1692 import unittest
1693
1694 class ExampleTests(unittest.TestCase):
1695 def setUp(self):
1696 raise RuntimeError('Fail')
1697
1698 def test_success(self):
1699 return
1700 """)
1701 testname = self.create_test(code=code)
1702
1703 output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
1704 self.check_executed_tests(output, testname,
1705 failed=[testname],
1706 rerun=Rerun(testname,
1707 match="test_success",
1708 success=False),
1709 stats=2)
1710
1711 def test_rerun_teardown_hook_failure(self):
1712 # FAILURE then FAILURE

Callers

nothing calls this directly

Calls 5

run_testsMethod · 0.95
RerunClass · 0.85
create_testMethod · 0.80
check_executed_testsMethod · 0.80
dedentMethod · 0.45

Tested by

no test coverage detected