about summary refs log blame commit diff stats
path: root/arc/factorial.mu
blob: 96a28fd3e6da197438589eaa95ecdfbfde5900a2 (plain) (tree)
LE) def mtime(): return os.stat(TESTDIR).st_mtime dir = Directory(TESTDIR) dir.load() # If the modification happens to be in the same second as the # last modification, it will result in mtime having the same # integer value. So we wait until the resolution is exceeded # and mtime differs. old_mtime = mtime() for i in range(50): modify_dir() if old_mtime != mtime(): break time.sleep(0.1) else: # fail after 5 seconds of trying self.fail( "Cannot perform test: mtime of TESTDIR is not being updated.") self.assertTrue(dir.load_if_outdated()) if __name__ == '__main__': unittest.main()