summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpxinwr <peixing.xin@windriver.com>2020-11-29 06:04:50 +0800
committerGitHub <noreply@github.com>2020-11-28 14:04:50 -0800
commita86a274b7224a5069f82c2d2cdd1f499d9c8dc22 (patch)
tree17c333d61fd18d7fccede0c238f56ddad96a0069
parent996a1ef8ae26869a5d0792e0bae615806f50594b (diff)
downloadcpython-git-a86a274b7224a5069f82c2d2cdd1f499d9c8dc22.tar.gz
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.
-rw-r--r--Doc/library/pipes.rst2
-rw-r--r--Lib/test/support/__init__.py2
-rw-r--r--Lib/test/test_pipes.py5
-rw-r--r--Misc/NEWS.d/next/Tests/2020-11-24-17-26-41.bpo-31904.eug834.rst1
4 files changed, 8 insertions, 2 deletions
diff --git a/Doc/library/pipes.rst b/Doc/library/pipes.rst
index 0a22da1f55..57e27a6acf 100644
--- a/Doc/library/pipes.rst
+++ b/Doc/library/pipes.rst
@@ -17,6 +17,8 @@ The :mod:`pipes` module defines a class to abstract the concept of a *pipeline*
Because the module uses :program:`/bin/sh` command lines, a POSIX or compatible
shell for :func:`os.system` and :func:`os.popen` is required.
+.. availability:: Unix. Not available on VxWorks.
+
The :mod:`pipes` module defines the following class:
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 4ba749454c..5a45d78be9 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -421,7 +421,7 @@ is_jython = sys.platform.startswith('java')
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 7d8cd54ba0..6a13b36d1c 100644
--- a/Lib/test/test_pipes.py
+++ b/Lib/test/test_pipes.py
@@ -3,13 +3,16 @@ import os
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
diff --git a/Misc/NEWS.d/next/Tests/2020-11-24-17-26-41.bpo-31904.eug834.rst b/Misc/NEWS.d/next/Tests/2020-11-24-17-26-41.bpo-31904.eug834.rst
new file mode 100644
index 0000000000..3e3942857b
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2020-11-24-17-26-41.bpo-31904.eug834.rst
@@ -0,0 +1 @@
+add shell requirement for test_pipes