diff options
author | Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> | 2022-04-30 20:38:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-30 20:38:19 -0400 |
commit | b9636180b32ea483f12564657ba1c3eb5b6d73d8 (patch) | |
tree | 24f98215a2c5d8caca0abdadd1b38928786beeb3 /Lib/test/test_subprocess.py | |
parent | 238aa6253bcd89a4eff50513cd72c07054e47d8e (diff) | |
download | cpython-b9636180b32ea483f12564657ba1c3eb5b6d73d8.tar.gz cpython-b9636180b32ea483f12564657ba1c3eb5b6d73d8.zip |
gh-91954: Use shell=True in test_subprocess.test_encoding_warning (GH-92090)
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 5814a6d924e..0764120952e 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1736,16 +1736,15 @@ class RunFuncTestCase(BaseTestCase): def test_encoding_warning(self): code = textwrap.dedent("""\ from subprocess import * - args = ["echo", "hello"] - run(args, text=True) - check_output(args, text=True) + run("echo hello", shell=True, text=True) + check_output("echo hello", shell=True, text=True) """) cp = subprocess.run([sys.executable, "-Xwarn_default_encoding", "-c", code], capture_output=True) lines = cp.stderr.splitlines() - self.assertEqual(len(lines), 2) - self.assertTrue(lines[0].startswith(b"<string>:3: EncodingWarning: ")) - self.assertTrue(lines[1].startswith(b"<string>:4: EncodingWarning: ")) + self.assertEqual(len(lines), 2, lines) + self.assertTrue(lines[0].startswith(b"<string>:2: EncodingWarning: ")) + self.assertTrue(lines[1].startswith(b"<string>:3: EncodingWarning: ")) def _get_test_grp_name(): |