summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_atexit.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/_test_atexit.py')
-rw-r--r--Lib/test/_test_atexit.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/_test_atexit.py b/Lib/test/_test_atexit.py
index 55d2808..f618c1f 100644
--- a/Lib/test/_test_atexit.py
+++ b/Lib/test/_test_atexit.py
@@ -19,7 +19,9 @@ class GeneralTest(unittest.TestCase):
atexit.register(func, *args)
atexit._run_exitfuncs()
- self.assertEqual(cm.unraisable.object, func)
+ self.assertIsNone(cm.unraisable.object)
+ self.assertEqual(cm.unraisable.err_msg,
+ f'Exception ignored in atexit callback {func!r}')
self.assertEqual(cm.unraisable.exc_type, exc_type)
self.assertEqual(type(cm.unraisable.exc_value), exc_type)
@@ -125,7 +127,9 @@ class GeneralTest(unittest.TestCase):
try:
with support.catch_unraisable_exception() as cm:
atexit._run_exitfuncs()
- self.assertEqual(cm.unraisable.object, func)
+ self.assertIsNone(cm.unraisable.object)
+ self.assertEqual(cm.unraisable.err_msg,
+ f'Exception ignored in atexit callback {func!r}')
self.assertEqual(cm.unraisable.exc_type, ZeroDivisionError)
self.assertEqual(type(cm.unraisable.exc_value), ZeroDivisionError)
finally: