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

Method test_rerun_setup_module_hook_failure

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

Source from the content-addressed store, hash-verified

1643 stats=2)
1644
1645 def test_rerun_setup_module_hook_failure(self):
1646 # FAILURE then FAILURE
1647 code = textwrap.dedent("""
1648 import unittest
1649
1650 def setUpModule():
1651 raise RuntimeError('Fail')
1652
1653 class ExampleTests(unittest.TestCase):
1654 def test_success(self):
1655 return
1656 """)
1657 testname = self.create_test(code=code)
1658
1659 output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
1660 self.check_executed_tests(output, testname,
1661 failed=[testname],
1662 rerun=Rerun(testname,
1663 match=None,
1664 success=False),
1665 stats=0)
1666
1667 def test_rerun_teardown_module_hook_failure(self):
1668 # 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