Skip to content

Commit 3453616

Browse files
committed
use shell=True
1 parent 4b18e6e commit 3453616

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Lib/test/test_subprocess.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,16 +1736,15 @@ def test_run_with_shell_timeout_and_capture_output(self):
17361736
def test_encoding_warning(self):
17371737
code = textwrap.dedent("""\
17381738
from subprocess import *
1739-
args = ["echo", "hello"]
1740-
run(args, text=True)
1741-
check_output(args, text=True)
1739+
run("echo hello", shell=True, text=True)
1740+
check_output("echo hello", shell=True, text=True)
17421741
""")
17431742
cp = subprocess.run([sys.executable, "-Xwarn_default_encoding", "-c", code],
17441743
capture_output=True)
17451744
lines = cp.stderr.splitlines()
17461745
self.assertEqual(len(lines), 2, lines)
1747-
self.assertTrue(lines[0].startswith(b"<string>:3: EncodingWarning: "))
1748-
self.assertTrue(lines[1].startswith(b"<string>:4: EncodingWarning: "))
1746+
self.assertTrue(lines[0].startswith(b"<string>:2: EncodingWarning: "))
1747+
self.assertTrue(lines[1].startswith(b"<string>:3: EncodingWarning: "))
17491748

17501749

17511750
def _get_test_grp_name():

0 commit comments

Comments
 (0)