(self)
| 365 | self.assertIsInstance(formatted_exc, str) |
| 366 | |
| 367 | def test_addError_locals(self): |
| 368 | class Foo(unittest.TestCase): |
| 369 | def test_1(self): |
| 370 | 1/0 |
| 371 | |
| 372 | test = Foo('test_1') |
| 373 | result = unittest.TestResult() |
| 374 | result.tb_locals = True |
| 375 | |
| 376 | unittest.result.traceback = MockTraceback |
| 377 | self.addCleanup(restore_traceback) |
| 378 | result.startTestRun() |
| 379 | test.run(result) |
| 380 | result.stopTestRun() |
| 381 | |
| 382 | self.assertEqual(len(result.errors), 1) |
| 383 | test_case, formatted_exc = result.errors[0] |
| 384 | self.assertEqual('A tracebacklocals', formatted_exc) |
| 385 | |
| 386 | def test_addSubTest(self): |
| 387 | class Foo(unittest.TestCase): |
nothing calls this directly
no test coverage detected