From f461d4099cdd38e51cb3c6875f7bb9d1973223ec Mon Sep 17 00:00:00 2001 From: Andrey Maltsev Date: Sun, 2 Apr 2023 14:40:08 +0000 Subject: [PATCH] Update test_faulthandler.py from Cpython v3.11.2 --- Lib/test/test_faulthandler.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py index 533203cfe5..c9838cb714 100644 --- a/Lib/test/test_faulthandler.py +++ b/Lib/test/test_faulthandler.py @@ -19,6 +19,9 @@ except ImportError: _testcapi = None +if not support.has_subprocess_support: + raise unittest.SkipTest("test module requires subprocess") + TIMEOUT = 0.5 MS_WINDOWS = (os.name == 'nt') @@ -46,6 +49,7 @@ def temporary_filename(): os_helper.unlink(filename) class FaultHandlerTests(unittest.TestCase): + def get_output(self, code, filename=None, fd=None): """ Run the specified code in Python (in a new child process) and read the @@ -432,6 +436,7 @@ def test_is_enabled(self): # TODO: RUSTPYTHON, subprocess.CalledProcessError: Command ... returned non-zero exit status 1. @unittest.expectedFailure + @support.requires_subprocess() def test_disabled_by_default(self): # By default, the module should be disabled code = "import faulthandler; print(faulthandler.is_enabled())" @@ -442,6 +447,7 @@ def test_disabled_by_default(self): # TODO: RUSTPYTHON, subprocess.CalledProcessError: Command '' returned non-zero exit status 1. @unittest.expectedFailure + @support.requires_subprocess() def test_sys_xoptions(self): # Test python -X faulthandler code = "import faulthandler; print(faulthandler.is_enabled())" @@ -456,6 +462,7 @@ def test_sys_xoptions(self): # TODO: RUSTPYTHON @unittest.expectedFailure + @support.requires_subprocess() def test_env_var(self): # empty env var code = "import faulthandler; print(faulthandler.is_enabled())"