Update test_faulthandler.py from Cpython v3.11.2

This commit is contained in:
Andrey Maltsev committed 2023-04-02 14:40:08 +00:00
1 parent 07bad48dbc
commit f461d4099c
1 file changed
+7
+7
View File
@@ -19,6 +19,9 @@ try:
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 @@ class FaultHandlerTests(unittest.TestCase):
# 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 @@ class FaultHandlerTests(unittest.TestCase):
# TODO: RUSTPYTHON, subprocess.CalledProcessError: Command '<filter object at ...>' 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 @@ class FaultHandlerTests(unittest.TestCase):
# TODO: RUSTPYTHON
@unittest.expectedFailure
@support.requires_subprocess()
def test_env_var(self):
# empty env var
code = "import faulthandler; print(faulthandler.is_enabled())"