Commit eea53210 authored by Jason Madden's avatar Jason Madden

Fix the subprocess tests on PyPy: they fail even in a stock build, so skip the...

Fix the subprocess tests on PyPy: they fail even in a stock build, so skip the one that's a problem.
parent 46ac1b2b
...@@ -142,14 +142,16 @@ def check_output(*popenargs, **kwargs): ...@@ -142,14 +142,16 @@ def check_output(*popenargs, **kwargs):
The arguments are the same as for the Popen constructor. Example: The arguments are the same as for the Popen constructor. Example:
>>> check_output(["ls", "-1", "/dev/null"]) >>> print(check_output(["ls", "-1", "/dev/null"]))
b'/dev/null\n' /dev/null
<BLANKLINE>
The stdout argument is not allowed as it is used internally. The stdout argument is not allowed as it is used internally.
To capture standard error in the result, use stderr=STDOUT. To capture standard error in the result, use stderr=STDOUT.
>>> check_output(["/bin/sh", "-c", "echo hello world"], stderr=STDOUT) >>> print(check_output(["/bin/sh", "-c", "echo hello world"], stderr=STDOUT))
b'hello world\n' hello world
<BLANKLINE>
""" """
if 'stdout' in kwargs: if 'stdout' in kwargs:
raise ValueError('stdout argument not allowed, it will be overridden.') raise ValueError('stdout argument not allowed, it will be overridden.')
......
...@@ -20,6 +20,7 @@ except ImportError: ...@@ -20,6 +20,7 @@ except ImportError:
threading = None threading = None
mswindows = (sys.platform == "win32") mswindows = (sys.platform == "win32")
PYPY = hasattr(sys, 'pypy_version_info')
# #
# Depends on the following external programs: Python # Depends on the following external programs: Python
...@@ -193,8 +194,8 @@ class ProcessTestCase(BaseTestCase): ...@@ -193,8 +194,8 @@ class ProcessTestCase(BaseTestCase):
p.wait() p.wait()
self.assertEqual(p.returncode, 47) self.assertEqual(p.returncode, 47)
@unittest.skipIf(sysconfig.is_python_build(), @unittest.skipIf(sysconfig.is_python_build() or PYPY,
"need an installed Python. See #7774") "need an installed Python. See #7774. Also fails to get sys.prefix on PyPy")
def test_executable_without_cwd(self): def test_executable_without_cwd(self):
# For a normal installation, it should work without 'cwd' # For a normal installation, it should work without 'cwd'
# argument. For test runs in the build directory, see #7774. # argument. For test runs in the build directory, see #7774.
......
...@@ -76,9 +76,6 @@ if PYPY: ...@@ -76,9 +76,6 @@ if PYPY:
# check_sendall_interrupted and testInterruptedTimeout fail due to # check_sendall_interrupted and testInterruptedTimeout fail due to
# https://bitbucket.org/cffi/cffi/issue/152/handling-errors-from-signal-handlers-in # https://bitbucket.org/cffi/cffi/issue/152/handling-errors-from-signal-handlers-in
'test_socket.py', 'test_socket.py',
# No idea!
'test_subprocess.py', # test_executable_without_cwd
] ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment