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 12
12
from unittest import TestCase , skipUnless , skipIf
13
13
from unittest .mock import patch
14
14
from 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
16
16
from test .support .import_helper import import_module
17
17
from test .support .os_helper import EnvironmentVarGuard , unlink
18
18
38
38
39
39
40
40
class ReplTestCase (TestCase ):
41
+ def setUp (self ):
42
+ if not has_subprocess_support :
43
+ raise unittest .SkipTest ("test module requires subprocess" )
44
+
41
45
def run_repl (
42
46
self ,
43
47
repl_input : str | list [str ],
@@ -1371,6 +1375,7 @@ def setUp(self):
1371
1375
# Cleanup from PYTHON* variables to isolate from local
1372
1376
# user settings, see #121359. Such variables should be
1373
1377
# added later in test methods to patched os.environ.
1378
+ super ().setUp ()
1374
1379
patcher = patch ('os.environ' , new = make_clean_env ())
1375
1380
self .addCleanup (patcher .stop )
1376
1381
patcher .start ()
Original file line number Diff line number Diff line change 5
5
import subprocess
6
6
import sys
7
7
import unittest
8
- from test .support import requires
8
+ from test .support import requires , has_subprocess_support
9
9
from textwrap import dedent
10
10
11
11
# Only run these tests if curses is available
@@ -38,6 +38,10 @@ def setUp(self):
38
38
raise unittest .SkipTest (
39
39
"`curses` capability provided to regrtest but `_curses` not importable"
40
40
)
41
+
42
+ if not has_subprocess_support :
43
+ raise unittest .SkipTest ("test module requires subprocess" )
44
+
41
45
self .original_term = os .environ .get ("TERM" , None )
42
46
43
47
def tearDown (self ):
You can’t perform that action at this time.
0 commit comments