Skip to content

Update test_faulthandler.py from Cpython v3.11.2 #4820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Lib/test/test_faulthandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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())"
Expand All @@ -442,6 +447,7 @@ def test_disabled_by_default(self):

# 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())"
Expand All @@ -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())"
Expand Down