mirror of https://github.com/python/cpython
bpo-32374: Ignore Python-level exceptions in test_bad_traverse (GH-7145)
This commit is contained in:
parent
97b523db7c
commit
08c5aca9d1
|
@ -275,13 +275,19 @@ class MultiPhaseExtensionModuleTests(abc.LoaderTests):
|
||||||
(Multiphase initialization modules only)
|
(Multiphase initialization modules only)
|
||||||
'''
|
'''
|
||||||
script = """if True:
|
script = """if True:
|
||||||
from test import support
|
try:
|
||||||
import importlib.util as util
|
from test import support
|
||||||
spec = util.find_spec('_testmultiphase')
|
import importlib.util as util
|
||||||
spec.name = '_testmultiphase_with_bad_traverse'
|
spec = util.find_spec('_testmultiphase')
|
||||||
|
spec.name = '_testmultiphase_with_bad_traverse'
|
||||||
|
|
||||||
with support.SuppressCrashReport():
|
with support.SuppressCrashReport():
|
||||||
m = spec.loader.create_module(spec)"""
|
m = spec.loader.create_module(spec)
|
||||||
|
except:
|
||||||
|
# Prevent Python-level exceptions from
|
||||||
|
# ending the process with non-zero status
|
||||||
|
# (We are testing for a crash in C-code)
|
||||||
|
pass"""
|
||||||
assert_python_failure("-c", script)
|
assert_python_failure("-c", script)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue