(pytester: Pytester)
| 167 | |
| 168 | |
| 169 | def test_teardown(pytester: Pytester) -> None: |
| 170 | testpath = pytester.makepyfile( |
| 171 | """ |
| 172 | import unittest |
| 173 | class MyTestCase(unittest.TestCase): |
| 174 | values = [] |
| 175 | def test_one(self): |
| 176 | pass |
| 177 | def tearDown(self): |
| 178 | self.values.append(None) |
| 179 | class Second(unittest.TestCase): |
| 180 | def test_check(self): |
| 181 | self.assertEqual(MyTestCase.values, [None]) |
| 182 | """ |
| 183 | ) |
| 184 | reprec = pytester.inline_run(testpath) |
| 185 | passed, skipped, failed = reprec.countoutcomes() |
| 186 | assert failed == 0, failed |
| 187 | assert passed == 2 |
| 188 | assert passed + skipped + failed == 2 |
| 189 | |
| 190 | |
| 191 | def test_teardown_issue1649(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected