(self)
| 3877 | self.assertEqual(list(excs[0].format()), list(excs[1].format())) |
| 3878 | |
| 3879 | def test_unhashable(self): |
| 3880 | class UnhashableException(Exception): |
| 3881 | def __eq__(self, other): |
| 3882 | return True |
| 3883 | |
| 3884 | ex1 = UnhashableException('ex1') |
| 3885 | ex2 = UnhashableException('ex2') |
| 3886 | try: |
| 3887 | raise ex2 from ex1 |
| 3888 | except UnhashableException: |
| 3889 | try: |
| 3890 | raise ex1 |
| 3891 | except UnhashableException as e: |
| 3892 | exc_obj = e |
| 3893 | exc = traceback.TracebackException.from_exception(exc_obj) |
| 3894 | formatted = list(exc.format()) |
| 3895 | self.assertIn('UnhashableException: ex2\n', formatted[2]) |
| 3896 | self.assertIn('UnhashableException: ex1\n', formatted[6]) |
| 3897 | |
| 3898 | def test_limit(self): |
| 3899 | def recurse(n): |
nothing calls this directly
no test coverage detected