Skip to content

Commit a86a274

Browse files
authored
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.
1 parent 996a1ef commit a86a274

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

Doc/library/pipes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ The :mod:`pipes` module defines a class to abstract the concept of a *pipeline*
1717
Because the module uses :program:`/bin/sh` command lines, a POSIX or compatible
1818
shell for :func:`os.system` and :func:`os.popen` is required.
1919

20+
.. availability:: Unix. Not available on VxWorks.
21+
2022
The :mod:`pipes` module defines the following class:
2123

2224

Lib/test/support/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def requires_lzma(reason='requires lzma'):
421421

422422
is_android = hasattr(sys, 'getandroidapilevel')
423423

424-
if sys.platform != 'win32':
424+
if sys.platform not in ('win32', 'vxworks'):
425425
unix_shell = '/system/bin/sh' if is_android else '/bin/sh'
426426
else:
427427
unix_shell = None

Lib/test/test_pipes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
import string
44
import unittest
55
import shutil
6-
from test.support import run_unittest, reap_children
6+
from test.support import run_unittest, reap_children, unix_shell
77
from test.support.os_helper import TESTFN, unlink
88

99

1010
if os.name != 'posix':
1111
raise unittest.SkipTest('pipes module only works on posix')
1212

13+
if not (unix_shell and os.path.exists(unix_shell)):
14+
raise unittest.SkipTest('pipes module requires a shell')
15+
1316
TESTFN2 = TESTFN + "2"
1417

1518
# tr a-z A-Z is not portable, so make the ranges explicit
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add shell requirement for test_pipes

0 commit comments

Comments
 (0)