(self)
| 119 | self.assertEqual(l, [5]) |
| 120 | |
| 121 | def test_atexit_with_unregistered_function(self): |
| 122 | # See bpo-46025 for more info |
| 123 | def func(): |
| 124 | atexit.unregister(func) |
| 125 | 1/0 |
| 126 | atexit.register(func) |
| 127 | try: |
| 128 | with support.catch_unraisable_exception() as cm: |
| 129 | atexit._run_exitfuncs() |
| 130 | self.assertIsNone(cm.unraisable.object) |
| 131 | self.assertEqual(cm.unraisable.err_msg, |
| 132 | f'Exception ignored in atexit callback {func!r}') |
| 133 | self.assertEqual(cm.unraisable.exc_type, ZeroDivisionError) |
| 134 | self.assertEqual(type(cm.unraisable.exc_value), ZeroDivisionError) |
| 135 | finally: |
| 136 | atexit.unregister(func) |
| 137 | |
| 138 | def test_eq_unregister_clear(self): |
| 139 | # Issue #112127: callback's __eq__ may call unregister or _clear |
nothing calls this directly
no test coverage detected