(self)
| 3799 | self.assertEqual(list(excs[0].format()), list(excs[1].format())) |
| 3800 | |
| 3801 | def test_unhashable(self): |
| 3802 | class UnhashableException(Exception): |
| 3803 | def __eq__(self, other): |
| 3804 | return True |
| 3805 | |
| 3806 | ex1 = UnhashableException('ex1') |
| 3807 | ex2 = UnhashableException('ex2') |
| 3808 | try: |
| 3809 | raise ex2 from ex1 |
| 3810 | except UnhashableException: |
| 3811 | try: |
| 3812 | raise ex1 |
| 3813 | except UnhashableException as e: |
| 3814 | exc_obj = e |
| 3815 | exc = traceback.TracebackException.from_exception(exc_obj) |
| 3816 | formatted = list(exc.format()) |
| 3817 | self.assertIn('UnhashableException: ex2\n', formatted[2]) |
| 3818 | self.assertIn('UnhashableException: ex1\n', formatted[6]) |
| 3819 | |
| 3820 | def test_limit(self): |
| 3821 | def recurse(n): |
nothing calls this directly
no test coverage detected