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

Method test_function

Lib/test/test_unittest/test_break.py:82–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80 self.assertTrue(result.shouldStop)
81
82 def test_function():
83 result = unittest.TestResult()
84 unittest.installHandler()
85 unittest.registerResult(result)
86
87 self.assertNotEqual(
88 signal.getsignal(signal.SIGINT),
89 self._default_handler,
90 )
91
92 try:
93 test(result)
94 except KeyboardInterrupt:
95 self.fail("KeyboardInterrupt not handled")
96 self.assertTrue(result.breakCaught)
97 self.withRepeats(test_function)
98
99 def testSecondInterrupt(self):

Callers

nothing calls this directly

Calls 8

testFunction · 0.90
assertNotEqualMethod · 0.80
assertTrueMethod · 0.80
assertFalseMethod · 0.80
failMethod · 0.45
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
killMethod · 0.45

Tested by

no test coverage detected