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

Method test_force

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

Source from the content-addressed store, hash-verified

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