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

Method test_rerun_setup_class_hook_failure

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

Source from the content-addressed store, hash-verified

1597 os_helper.unlink(marker_filename)
1598
1599 def test_rerun_setup_class_hook_failure(self):
1600 # FAILURE then FAILURE
1601 code = textwrap.dedent("""
1602 import unittest
1603
1604 class ExampleTests(unittest.TestCase):
1605 @classmethod
1606 def setUpClass(self):
1607 raise RuntimeError('Fail')
1608
1609 def test_success(self):
1610 return
1611 """)
1612 testname = self.create_test(code=code)
1613
1614 output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
1615 self.check_executed_tests(output, testname,
1616 failed=[testname],
1617 rerun=Rerun(testname,
1618 match="ExampleTests",
1619 success=False),
1620 stats=0)
1621
1622 def test_rerun_teardown_class_hook_failure(self):
1623 # 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