MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_rerun_setup_hook_failure

Method test_rerun_setup_hook_failure

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

Source from the content-addressed store, hash-verified

1654 stats=2)
1655
1656 def test_rerun_setup_hook_failure(self):
1657 # FAILURE then FAILURE
1658 code = textwrap.dedent("""
1659 import unittest
1660
1661 class ExampleTests(unittest.TestCase):
1662 def setUp(self):
1663 raise RuntimeError('Fail')
1664
1665 def test_success(self):
1666 return
1667 """)
1668 testname = self.create_test(code=code)
1669
1670 output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
1671 self.check_executed_tests(output, testname,
1672 failed=[testname],
1673 rerun=Rerun(testname,
1674 match="test_success",
1675 success=False),
1676 stats=2)
1677
1678 def test_rerun_teardown_hook_failure(self):
1679 # FAILURE then FAILURE

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected