You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_pyinit_function_raises_exception doesn't work without _testsinglephase #156676
#Lib/test/test_import/__init__.py, it needs to be decorated with: @unittest.skipIf(_testsinglephaseisNone, "test requires _testsinglephase module")# and the import needs to be removed #Throws an error : ```Lib/test/test_import/__init__.pylines2547to2551@requires_subinterpretersdeftest_pyinit_function_raises_exception(self):
# gh-144601: PyInit functions that raised exceptions would cause a# crash when imported from a subinterpreter.import_testsinglephase```
Lib/test/test_import/init.py lines 2547 to 2551
@requires_subinterpreters
def test_pyinit_function_raises_exception(self):
# gh-144601: PyInit functions that raised exceptions would cause a
# crash when imported from a subinterpreter.
import _testsinglephase
Activity
saioffl commentedon Aug 30, 2026
Lib/test/test_import/init.py lines 2547 to 2551
@requires_subinterpreters
def test_pyinit_function_raises_exception(self):
# gh-144601: PyInit functions that raised exceptions would cause a
# crash when imported from a subinterpreter.
import _testsinglephase
The exact error message
StanFromIreland commentedon Aug 30, 2026
Do you want to open a PR for this?
saioffl commentedon Aug 30, 2026
Yes, I’d be happy to work on this and open a PR.
[-]A small Improvement[/-][+]`test_pyinit_function_raises_exception` doesn't work without `_testsinglephase`[/+]gh-156676: Skip `test_pyinit_function_raises_exception` for other imp…
ZeroIntensity commentedon Aug 30, 2026
Backports are on auto-merge and the 3.15 PR is waiting on Hugo -- thanks for the fix!
[3.13] gh-156676: Skip `test_pyinit_function_raises_exception` for ot…
[3.14] gh-156676: Skip `test_pyinit_function_raises_exception` for ot…
[3.15] gh-156676: Skip `test_pyinit_function_raises_exception` for ot…
pythongh-156676: Skip `test_pyinit_function_raises_exception` for oth…