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

Method test_rerun_fail

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

Source from the content-addressed store, hash-verified

1499 stats=2)
1500
1501 def test_rerun_fail(self):
1502 # FAILURE then FAILURE
1503 code = textwrap.dedent("""
1504 import unittest
1505
1506 class Tests(unittest.TestCase):
1507 def test_succeed(self):
1508 return
1509
1510 def test_fail_always(self):
1511 # test that always fails
1512 self.fail("bug")
1513 """)
1514 testname = self.create_test(code=code)
1515
1516 output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
1517 self.check_executed_tests(output, [testname],
1518 rerun=Rerun(testname,
1519 "test_fail_always",
1520 success=False),
1521 stats=TestStats(3, 2))
1522
1523 def test_rerun_success(self):
1524 # FAILURE then SUCCESS

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected