MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_encoding_warning

Method test_encoding_warning

Lib/test/test_subprocess.py:1973–1984  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1971 f"{stacks}```")
1972
1973 def test_encoding_warning(self):
1974 code = textwrap.dedent("""\
1975 from subprocess import *
1976 run("echo hello", shell=True, text=True)
1977 check_output("echo hello", shell=True, text=True)
1978 """)
1979 cp = subprocess.run([sys.executable, "-Xwarn_default_encoding", "-c", code],
1980 capture_output=True)
1981 lines = cp.stderr.splitlines()
1982 self.assertEqual(len(lines), 2, lines)
1983 self.assertStartsWith(lines[0], b"<string>:2: EncodingWarning: ")
1984 self.assertStartsWith(lines[1], b"<string>:3: EncodingWarning: ")
1985
1986
1987def _get_test_grp_name():

Callers

nothing calls this directly

Calls 6

lenFunction · 0.85
dedentMethod · 0.80
runMethod · 0.45
splitlinesMethod · 0.45
assertEqualMethod · 0.45
assertStartsWithMethod · 0.45

Tested by

no test coverage detected