MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_bytecode

Method test_bytecode

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

Source from the content-addressed store, hash-verified

381 self._do_test(same_name_as_bad_test)
382
383 def test_bytecode(self):
384 base_path = os.path.join(self.test_dir, 'a')
385 source_path = base_path + importlib.machinery.SOURCE_SUFFIXES[0]
386 bytecode_path = base_path + importlib.machinery.BYTECODE_SUFFIXES[0]
387 with open_file(source_path) as file:
388 file.write('testing_modulefinder = True\n'.encode('utf-8'))
389 py_compile.compile(source_path, cfile=bytecode_path)
390 os.remove(source_path)
391 self._do_test(bytecode_test)
392
393 # TODO: RUSTPYTHON; panics at code.rs with 'called Option::unwrap() on a None value'
394 @unittest.skip("TODO: RUSTPYTHON; panics in co_filename replacement")

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