MCPcopy Index your code
hub / github.com/python/cpython / test_py_shebang_valid_bom

Method test_py_shebang_valid_bom

Lib/test/test_launcher.py:637–644  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

635 self.assertEqual(f'X.Y.exe -prearg "{script}" -postarg', data["stdout"].strip())
636
637 def test_py_shebang_valid_bom(self):
638 with self.py_ini(TEST_PY_DEFAULTS):
639 content = "#! /usr/bin/python -prearg".encode("utf-8")
640 with self.script(b"\xEF\xBB\xBF" + content) as script:
641 data = self.run_py([script, "-postarg"])
642 self.assertEqual("PythonTestSuite", data["SearchInfo.company"])
643 self.assertEqual("3.100", data["SearchInfo.tag"])
644 self.assertEqual(f"X.Y.exe -prearg {quote(script)} -postarg", data["stdout"].strip())
645
646 def test_py_shebang_invalid_bom(self):
647 with self.py_ini(TEST_PY_DEFAULTS):

Callers

nothing calls this directly

Calls 7

py_iniMethod · 0.80
run_pyMethod · 0.80
quoteFunction · 0.70
encodeMethod · 0.45
scriptMethod · 0.45
assertEqualMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected