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

Method test_startTest

Lib/test/test_unittest/test_result.py:70–87  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

68 # "Called when the test case test is about to be run. The default
69 # implementation simply increments the instance's testsRun counter."
70 def test_startTest(self):
71 class Foo(unittest.TestCase):
72 def test_1(self):
73 pass
74
75 test = Foo('test_1')
76
77 result = unittest.TestResult()
78
79 result.startTest(test)
80
81 self.assertTrue(result.wasSuccessful())
82 self.assertEqual(len(result.errors), 0)
83 self.assertEqual(len(result.failures), 0)
84 self.assertEqual(result.testsRun, 1)
85 self.assertEqual(result.shouldStop, False)
86
87 result.stopTest(test)
88
89 # "Called after the test case test has been executed, regardless of
90 # the outcome. The default implementation does nothing."

Callers

nothing calls this directly

Calls 6

startTestMethod · 0.95
wasSuccessfulMethod · 0.95
stopTestMethod · 0.95
assertTrueMethod · 0.80
FooClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected