Issue #19715: try the utime(..., None) approach again, now that it should be more precise under Windows

This commit is contained in:
Antoine Pitrou 2013-11-23 15:25:59 +01:00
parent 91a7af3e48
commit 2cf3917954
2 changed files with 3 additions and 8 deletions

View file

@ -1391,11 +1391,8 @@ class _BasePathTest(object):
# The file mtime should be refreshed by calling touch() again
p.touch()
st = p.stat()
# Issue #19715: there can be an inconsistency under Windows between
# the timestamp rounding when creating a file, and the timestamp
# rounding done when calling utime(). `delta` makes up for this.
delta = 1e-6 if os.name == 'nt' else 0
self.assertGreaterEqual(st.st_mtime, old_mtime - delta)
self.assertGreaterEqual(st.st_mtime_ns, old_mtime_ns)
self.assertGreaterEqual(st.st_mtime, old_mtime)
# Now with exist_ok=False
p = P / 'newfileB'
self.assertFalse(p.exists())