bpo-31904: add shell requirement for test_pipes (GH-23489)
VxWorks has no user space shell provided so it can't support pipes module. Also add shell requirement for running test_pipes.
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 4ba7494..5a45d78 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -421,7 +421,7 @@ def requires_lzma(reason='requires lzma'):
is_android = hasattr(sys, 'getandroidapilevel')
-if sys.platform != 'win32':
+if sys.platform not in ('win32', 'vxworks'):
unix_shell = '/system/bin/sh' if is_android else '/bin/sh'
else:
unix_shell = None
diff --git a/Lib/test/test_pipes.py b/Lib/test/test_pipes.py
index 7d8cd54..6a13b36 100644
--- a/Lib/test/test_pipes.py
+++ b/Lib/test/test_pipes.py
@@ -3,13 +3,16 @@
import string
import unittest
import shutil
-from test.support import run_unittest, reap_children
+from test.support import run_unittest, reap_children, unix_shell
from test.support.os_helper import TESTFN, unlink
if os.name != 'posix':
raise unittest.SkipTest('pipes module only works on posix')
+if not (unix_shell and os.path.exists(unix_shell)):
+ raise unittest.SkipTest('pipes module requires a shell')
+
TESTFN2 = TESTFN + "2"
# tr a-z A-Z is not portable, so make the ranges explicit