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

Method test_rerun_fail

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

Source from the content-addressed store, hash-verified

1532 stats=2)
1533
1534 def test_rerun_fail(self):
1535 # FAILURE then FAILURE
1536 code = textwrap.dedent("""
1537 import unittest
1538
1539 class Tests(unittest.TestCase):
1540 def test_succeed(self):
1541 return
1542
1543 def test_fail_always(self):
1544 # test that always fails
1545 self.fail("bug")
1546 """)
1547 testname = self.create_test(code=code)
1548
1549 output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
1550 self.check_executed_tests(output, [testname],
1551 rerun=Rerun(testname,
1552 "test_fail_always",
1553 success=False),
1554 stats=TestStats(3, 2))
1555
1556 def test_rerun_success(self):
1557 # FAILURE then SUCCESS

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected