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

Method test_stopTest

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

Source from the content-addressed store, hash-verified

93 # "Called after the test case test has been executed, regardless of
94 # the outcome. The default implementation does nothing."
95 def test_stopTest(self):
96 class Foo(unittest.TestCase):
97 def test_1(self):
98 pass
99
100 test = Foo('test_1')
101
102 result = unittest.TestResult()
103
104 result.startTest(test)
105
106 self.assertTrue(result.wasSuccessful())
107 self.assertEqual(len(result.errors), 0)
108 self.assertEqual(len(result.failures), 0)
109 self.assertEqual(result.testsRun, 1)
110 self.assertEqual(result.shouldStop, False)
111
112 result.stopTest(test)
113
114 # Same tests as above; make sure nothing has changed
115 self.assertTrue(result.wasSuccessful())
116 self.assertEqual(len(result.errors), 0)
117 self.assertEqual(len(result.failures), 0)
118 self.assertEqual(result.testsRun, 1)
119 self.assertEqual(result.shouldStop, False)
120
121 # "Called before and after tests are run. The default implementation does nothing."
122 def test_startTestRun_stopTestRun(self):

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected