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

Method test_duplicated_levels

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

Source from the content-addressed store, hash-verified

1082 self.assertTrue(is_hardlink(pyc1, pyc2))
1083
1084 def test_duplicated_levels(self):
1085 # compile_dir() must not fail if optimize contains duplicated
1086 # optimization levels and/or if optimization levels are not sorted.
1087 with self.temporary_directory():
1088 # code with no dostring and no assertion:
1089 # same bytecode for all optimization levels
1090 script = self.make_script(self.create_code())
1091 self.compile_dir(optimize=[1, 0, 1, 0])
1092 pyc1 = get_pyc(script, 0)
1093 pyc2 = get_pyc(script, 1)
1094 self.assertTrue(is_hardlink(pyc1, pyc2))
1095
1096 def test_recompilation(self):
1097 # Test compile_dir() when pyc files already exists and the script

Callers

nothing calls this directly

Calls 7

temporary_directoryMethod · 0.95
make_scriptMethod · 0.95
create_codeMethod · 0.95
compile_dirMethod · 0.95
get_pycFunction · 0.85
is_hardlinkFunction · 0.85
assertTrueMethod · 0.80

Tested by

no test coverage detected