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

Method test_failing_test

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

Source from the content-addressed store, hash-verified

1044 stats=1)
1045
1046 def test_failing_test(self):
1047 # test a failing test
1048 code = textwrap.dedent("""
1049 import unittest
1050
1051 class FailingTest(unittest.TestCase):
1052 def test_failing(self):
1053 self.fail("bug")
1054 """)
1055 test_ok = self.create_test('ok')
1056 test_failing = self.create_test('failing', code=code)
1057 tests = [test_ok, test_failing]
1058
1059 output = self.run_tests(*tests, exitcode=EXITCODE_BAD_TEST)
1060 self.check_executed_tests(output, tests, failed=test_failing,
1061 stats=TestStats(2, 1))
1062
1063 def test_resources(self):
1064 # test -u command line option

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected