mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Update test_faulthandler.py from Cpython v3.11.2
This commit is contained in:
1 parent
07bad48dbc
commit
f461d4099c
1 file changed
+7
Vendored
+7
@@ -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())"
|
||||
|
||||
Reference in new issue
Block a user