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

Method test_rerun_teardown_hook_failure

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

Source from the content-addressed store, hash-verified

1709 stats=2)
1710
1711 def test_rerun_teardown_hook_failure(self):
1712 # FAILURE then FAILURE
1713 code = textwrap.dedent("""
1714 import unittest
1715
1716 class ExampleTests(unittest.TestCase):
1717 def tearDown(self):
1718 raise RuntimeError('Fail')
1719
1720 def test_success(self):
1721 return
1722 """)
1723 testname = self.create_test(code=code)
1724
1725 output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
1726 self.check_executed_tests(output, testname,
1727 failed=[testname],
1728 rerun=Rerun(testname,
1729 match="test_success",
1730 success=False),
1731 stats=2)
1732
1733 def test_rerun_async_setup_hook_failure(self):
1734 # 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