(self)
| 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): |
nothing calls this directly
no test coverage detected