Skip to content

bpo-31904: add shell requirement for test_pipes #23489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Doc/library/pipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:


Expand Down
2 changes: 1 addition & 1 deletion Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Lib/test/test_pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add shell requirement for test_pipes