1919except ImportError :
2020 _testcapi = None
2121
22+ if not support .has_subprocess_support :
23+ raise unittest .SkipTest ("test module requires subprocess" )
24+
2225TIMEOUT = 0.5
2326MS_WINDOWS = (os .name == 'nt' )
2427
@@ -46,6 +49,7 @@ def temporary_filename():
4649 os_helper .unlink (filename )
4750
4851class 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