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

Method test_bytecode

Lib/test/test_modulefinder.py:398–406  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

396 self._do_test(same_name_as_bad_test)
397
398 def test_bytecode(self):
399 base_path = os.path.join(self.test_dir, 'a')
400 source_path = base_path + importlib.machinery.SOURCE_SUFFIXES[0]
401 bytecode_path = base_path + importlib.machinery.BYTECODE_SUFFIXES[0]
402 with open_file(source_path) as file:
403 file.write('testing_modulefinder = True\n'.encode('utf-8'))
404 py_compile.compile(source_path, cfile=bytecode_path)
405 os.remove(source_path)
406 self._do_test(bytecode_test)
407
408 def test_replace_paths(self):
409 old_path = os.path.join(self.test_dir, 'a', 'module.py')

Callers

nothing calls this directly

Calls 7

_do_testMethod · 0.95
open_fileFunction · 0.85
joinMethod · 0.45
writeMethod · 0.45
encodeMethod · 0.45
compileMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected