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

Method test_Py_CompileString

Lib/test/test_capi/test_misc.py:856–862  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

854 self.assertEqual(s, b'<NULL>')
855
856 def test_Py_CompileString(self):
857 # Check that Py_CompileString respects the coding cookie
858 _compile = _testcapi.Py_CompileString
859 code = b"# -*- coding: latin1 -*-\nprint('\xc2\xa4')\n"
860 result = _compile(code)
861 expected = compile(code, "<string>", "exec")
862 self.assertEqual(result.co_consts, expected.co_consts)
863
864 def test_export_symbols(self):
865 # bpo-44133: Ensure that the "Py_FrozenMain" and

Callers

nothing calls this directly

Calls 3

_compileFunction · 0.50
compileFunction · 0.50
assertEqualMethod · 0.45

Tested by

no test coverage detected