summaryrefslogtreecommitdiff
path: root/Lib/test/test_capi.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_capi.py')
-rw-r--r--Lib/test/test_capi.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index 0d5c97dcc2..5e72ba9eb0 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -556,6 +556,16 @@ class CAPITest(unittest.TestCase):
self.assertIn('Fatal Python error: test_fatal_error: MESSAGE\n',
err)
+ match = re.search('^Extension modules:(.*)$', err, re.MULTILINE)
+ if not match:
+ self.fail(f"Cannot find 'Extension modules:' in {err!r}")
+ modules = set(match.group(1).strip().split(', '))
+ # Test _PyModule_IsExtension(): the list doesn't have to
+ # be exhaustive.
+ for name in ('sys', 'builtins', '_imp', '_thread', '_weakref',
+ '_io', 'marshal', '_signal', '_abc', '_testcapi'):
+ self.assertIn(name, modules)
+
class TestPendingCalls(unittest.TestCase):