File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1212from unittest import TestCase , skipUnless , skipIf
1313from unittest .mock import patch
1414from test .support import force_not_colorized , make_clean_env , Py_DEBUG
15- from test .support import SHORT_TIMEOUT , STDLIB_DIR
15+ from test .support import has_subprocess_support , SHORT_TIMEOUT , STDLIB_DIR
1616from test .support .import_helper import import_module
1717from test .support .os_helper import EnvironmentVarGuard , unlink
1818
3838
3939
4040class ReplTestCase (TestCase ):
41+ def setUp (self ):
42+ if not has_subprocess_support :
43+ raise unittest .SkipTest ("test module requires subprocess" )
44+
4145 def run_repl (
4246 self ,
4347 repl_input : str | list [str ],
@@ -1371,6 +1375,7 @@ def setUp(self):
13711375 # Cleanup from PYTHON* variables to isolate from local
13721376 # user settings, see #121359. Such variables should be
13731377 # added later in test methods to patched os.environ.
1378+ super ().setUp ()
13741379 patcher = patch ('os.environ' , new = make_clean_env ())
13751380 self .addCleanup (patcher .stop )
13761381 patcher .start ()
Original file line number Diff line number Diff line change 55import subprocess
66import sys
77import unittest
8- from test .support import requires
8+ from test .support import requires , has_subprocess_support
99from textwrap import dedent
1010
1111# Only run these tests if curses is available
@@ -38,6 +38,10 @@ def setUp(self):
3838 raise unittest .SkipTest (
3939 "`curses` capability provided to regrtest but `_curses` not importable"
4040 )
41+
42+ if not has_subprocess_support :
43+ raise unittest .SkipTest ("test module requires subprocess" )
44+
4145 self .original_term = os .environ .get ("TERM" , None )
4246
4347 def tearDown (self ):
You can’t perform that action at this time.
0 commit comments