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

Method test_py_shebang_invalid_bom

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

Source from the content-addressed store, hash-verified

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):
648 content = "#! /usr/bin/python3 -prearg".encode("utf-8")
649 with self.script(b"\xEF\xAA\xBF" + content) as script:
650 data = self.run_py([script, "-postarg"])
651 self.assertIn("Invalid BOM", data["stderr"])
652 self.assertEqual("PythonTestSuite", data["SearchInfo.company"])
653 self.assertEqual("3.100", data["SearchInfo.tag"])
654 self.assertEqual(f"X.Y.exe {quote(script)} -postarg", data["stdout"].strip())
655
656 def test_py_handle_64_in_ini(self):
657 with self.py_ini("\n".join(["[defaults]", "python=3.999-64"])):

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected