summaryrefslogtreecommitdiff
path: root/Lib/test/test_faulthandler.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-01-19 23:35:27 +0100
committerGitHub <noreply@github.com>2021-01-19 23:35:27 +0100
commit66f77caca39ba39ebe1e4a95dba6d19b20d51951 (patch)
tree5a3e9d28e72c0c15c2e313b51eef7b239a0a4bdc /Lib/test/test_faulthandler.py
parentcad8020cb83ec6d904f874c0e4f599e651022196 (diff)
downloadcpython-git-66f77caca39ba39ebe1e4a95dba6d19b20d51951.tar.gz
bpo-42923: _Py_DumpExtensionModules() ignores stdlib ext (GH-24254)
Diffstat (limited to 'Lib/test/test_faulthandler.py')
-rw-r--r--Lib/test/test_faulthandler.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py
index c6b763a955..b4a654f8a9 100644
--- a/Lib/test/test_faulthandler.py
+++ b/Lib/test/test_faulthandler.py
@@ -334,19 +334,19 @@ class FaultHandlerTests(unittest.TestCase):
def test_dump_ext_modules(self):
code = """
import faulthandler
+ # _testcapi is a test module and not considered as a stdlib module
+ import _testcapi
faulthandler.enable()
faulthandler._sigsegv()
"""
stderr, exitcode = self.get_output(code)
stderr = '\n'.join(stderr)
- match = re.search('^Extension modules:(.*)$', stderr, re.MULTILINE)
+ match = re.search(r'^Extension modules:(.*) \(total: [0-9]+\)$',
+ stderr, re.MULTILINE)
if not match:
self.fail(f"Cannot find 'Extension modules:' in {stderr!r}")
modules = set(match.group(1).strip().split(', '))
- # Only check for a few extensions, the list doesn't have to be
- # exhaustive.
- for ext in ('sys', 'builtins', '_io', 'faulthandler'):
- self.assertIn(ext, modules)
+ self.assertIn('_testcapi', modules)
def test_is_enabled(self):
orig_stderr = sys.stderr