summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_importlib/extension/test_loader.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_importlib/extension/test_loader.py b/Lib/test/test_importlib/extension/test_loader.py
index d69192b..3bf2bbd 100644
--- a/Lib/test/test_importlib/extension/test_loader.py
+++ b/Lib/test/test_importlib/extension/test_loader.py
@@ -351,9 +351,14 @@ class MultiPhaseExtensionModuleTests(abc.LoaderTests):
]:
with self.subTest(name_base):
name = self.name + '_' + name_base
- with self.assertRaises(SystemError):
+ with self.assertRaises(SystemError) as cm:
self.load_module_by_name(name)
+ # If there is an unreported exception, it should be chained
+ # with the `SystemError`.
+ if "unreported_exception" in name_base:
+ self.assertIsNotNone(cm.exception.__cause__)
+
def test_nonascii(self):
# Test that modules with non-ASCII names can be loaded.
# punycode behaves slightly differently in some-ASCII and no-ASCII