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

Method test_optimize

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

Source from the content-addressed store, hash-verified

215
216
217 def test_optimize(self):
218 # make sure compiling with different optimization settings than the
219 # interpreter's creates the correct file names
220 optimize, opt = (1, 1) if __debug__ else (0, '')
221 compileall.compile_dir(self.directory, quiet=True, optimize=optimize)
222 cached = importlib.util.cache_from_source(self.source_path,
223 optimization=opt)
224 self.assertTrue(os.path.isfile(cached))
225 cached2 = importlib.util.cache_from_source(self.source_path2,
226 optimization=opt)
227 self.assertTrue(os.path.isfile(cached2))
228 cached3 = importlib.util.cache_from_source(self.source_path3,
229 optimization=opt)
230 self.assertTrue(os.path.isfile(cached3))
231
232 def test_compile_dir_pathlike(self):
233 self.assertFalse(os.path.isfile(self.bc_path))

Callers

nothing calls this directly

Calls 3

compile_dirMethod · 0.80
assertTrueMethod · 0.80
isfileMethod · 0.45

Tested by

no test coverage detected