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

Method test_prepend_only

Lib/test/test_compileall.py:394–407  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

392 )
393
394 def test_prepend_only(self):
395 fullpath = ["test", "build", "real", "path"]
396 path = os.path.join(self.directory, *fullpath)
397 os.makedirs(path)
398 script = script_helper.make_script(path, "test", "1 / 0")
399 bc = importlib.util.cache_from_source(script)
400 prependdir = "/foo"
401 compileall.compile_dir(path, quiet=True, prependdir=prependdir)
402 rc, out, err = script_helper.assert_python_failure(bc)
403 expected_in = os.path.join(prependdir, self.directory, *fullpath)
404 self.assertIn(
405 expected_in,
406 str(err, encoding=sys.getdefaultencoding())
407 )
408
409 def test_strip_and_prepend(self):
410 fullpath = ["test", "build", "real", "path"]

Callers

nothing calls this directly

Calls 6

strFunction · 0.85
compile_dirMethod · 0.80
assert_python_failureMethod · 0.80
assertInMethod · 0.80
joinMethod · 0.45
make_scriptMethod · 0.45

Tested by

no test coverage detected