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