(self)
| 634 | self.assertEqual(e.__notes__, 42) |
| 635 | |
| 636 | def testWithTraceback(self): |
| 637 | try: |
| 638 | raise IndexError(4) |
| 639 | except Exception as e: |
| 640 | tb = e.__traceback__ |
| 641 | |
| 642 | e = BaseException().with_traceback(tb) |
| 643 | self.assertIsInstance(e, BaseException) |
| 644 | self.assertEqual(e.__traceback__, tb) |
| 645 | |
| 646 | e = IndexError(5).with_traceback(tb) |
| 647 | self.assertIsInstance(e, IndexError) |
| 648 | self.assertEqual(e.__traceback__, tb) |
| 649 | |
| 650 | class MyException(Exception): |
| 651 | pass |
| 652 | |
| 653 | e = MyException().with_traceback(tb) |
| 654 | self.assertIsInstance(e, MyException) |
| 655 | self.assertEqual(e.__traceback__, tb) |
| 656 | |
| 657 | def testInvalidTraceback(self): |
| 658 | try: |
nothing calls this directly
no test coverage detected