summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-02-27 23:30:30 (GMT)
committerNed Deily <nad@python.org>2018-02-27 23:30:30 (GMT)
commitb7dcae358e9d5a3ac9dafec9f6b64e9a66843ad8 (patch)
tree49bf49d597c5817d37e3eaa5156c094a41ae4106 /Lib/test/test_subprocess.py
parent88369bf54580065efe2fbe46deba7e790ee41a9b (diff)
downloadcpython-b7dcae358e9d5a3ac9dafec9f6b64e9a66843ad8.zip
cpython-b7dcae358e9d5a3ac9dafec9f6b64e9a66843ad8.tar.gz
cpython-b7dcae358e9d5a3ac9dafec9f6b64e9a66843ad8.tar.bz2
Revert "bpo-31961: subprocess now accepts path-like args (GH-4329)" (GH-5912) (GH-5931)
* Revert "bpo-31961: subprocess now accepts path-like args (GH-4329)" This reverts commit dd42cb71f2cb02f3a32f016137b12a146bc0d0e2. (cherry picked from commit be50a7b627d0aa37e08fa8e2d5568891f19903ce) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index b3ccb0d..46cb5f1 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -1475,37 +1475,6 @@ class RunFuncTestCase(BaseTestCase):
env=newenv)
self.assertEqual(cp.returncode, 33)
- def test_run_with_pathlike_path(self):
- # bpo-31961: test run(pathlike_object)
- class Path:
- def __fspath__(self):
- # the name of a command that can be run without
- # any argumenets that exit fast
- return 'dir' if mswindows else 'ls'
-
- path = Path()
- if mswindows:
- res = subprocess.run(path, stdout=subprocess.DEVNULL, shell=True)
- else:
- res = subprocess.run(path, stdout=subprocess.DEVNULL)
-
- self.assertEqual(res.returncode, 0)
-
- def test_run_with_pathlike_path_and_arguments(self):
- # bpo-31961: test run([pathlike_object, 'additional arguments'])
- class Path:
- def __fspath__(self):
- # the name of a command that can be run without
- # any argumenets that exits fast
- return sys.executable
-
- path = Path()
-
- args = [path, '-c', 'import sys; sys.exit(57)']
- res = subprocess.run(args)
-
- self.assertEqual(res.returncode, 57)
-
def test_capture_output(self):
cp = self.run_python(("import sys;"
"sys.stdout.write('BDFL'); "