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

Method test_force

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

Source from the content-addressed store, hash-verified

662
663 @without_source_date_epoch # timestamp invalidation test
664 def test_force(self):
665 self.assertRunOK('-q', self.pkgdir)
666 pycpath = importlib.util.cache_from_source(self.barfn)
667 # set atime/mtime backward to avoid file timestamp resolution issues
668 os.utime(pycpath, (time.time()-60,)*2)
669 mtime = os.stat(pycpath).st_mtime
670 # without force, no recompilation
671 self.assertRunOK('-q', self.pkgdir)
672 mtime2 = os.stat(pycpath).st_mtime
673 self.assertEqual(mtime, mtime2)
674 # now force it.
675 self.assertRunOK('-q', '-f', self.pkgdir)
676 mtime2 = os.stat(pycpath).st_mtime
677 self.assertNotEqual(mtime, mtime2)
678
679 def test_recursion_control(self):
680 subpackage = os.path.join(self.pkgdir, 'spam')

Callers

nothing calls this directly

Calls 6

assertRunOKMethod · 0.95
utimeMethod · 0.80
assertNotEqualMethod · 0.80
timeMethod · 0.45
statMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected