Skip to content

Commit 31644f1

Browse files
authored
Merge pull request RustPython#4820 from Masorubka1/test_faulthandler
Update test_faulthandler.py from Cpython v3.11.2
2 parents aeba695 + f461d40 commit 31644f1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_faulthandler.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
except ImportError:
2020
_testcapi = None
2121

22+
if not support.has_subprocess_support:
23+
raise unittest.SkipTest("test module requires subprocess")
24+
2225
TIMEOUT = 0.5
2326
MS_WINDOWS = (os.name == 'nt')
2427

@@ -46,6 +49,7 @@ def temporary_filename():
4649
os_helper.unlink(filename)
4750

4851
class FaultHandlerTests(unittest.TestCase):
52+
4953
def get_output(self, code, filename=None, fd=None):
5054
"""
5155
Run the specified code in Python (in a new child process) and read the
@@ -432,6 +436,7 @@ def test_is_enabled(self):
432436

433437
# TODO: RUSTPYTHON, subprocess.CalledProcessError: Command ... returned non-zero exit status 1.
434438
@unittest.expectedFailure
439+
@support.requires_subprocess()
435440
def test_disabled_by_default(self):
436441
# By default, the module should be disabled
437442
code = "import faulthandler; print(faulthandler.is_enabled())"
@@ -442,6 +447,7 @@ def test_disabled_by_default(self):
442447

443448
# TODO: RUSTPYTHON, subprocess.CalledProcessError: Command '<filter object at ...>' returned non-zero exit status 1.
444449
@unittest.expectedFailure
450+
@support.requires_subprocess()
445451
def test_sys_xoptions(self):
446452
# Test python -X faulthandler
447453
code = "import faulthandler; print(faulthandler.is_enabled())"
@@ -456,6 +462,7 @@ def test_sys_xoptions(self):
456462

457463
# TODO: RUSTPYTHON
458464
@unittest.expectedFailure
465+
@support.requires_subprocess()
459466
def test_env_var(self):
460467
# empty env var
461468
code = "import faulthandler; print(faulthandler.is_enabled())"

0 commit comments

Comments
 (0)