mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Revert utime(..., None) strategy (it has too poor resolution under Windows) and restore the previous test workaround
(issue #19715)
This commit is contained in:
parent
c3055be5f3
commit
12820c0d5d
2 changed files with 8 additions and 3 deletions
|
@ -1391,8 +1391,11 @@ class _BasePathTest(object):
|
|||
# The file mtime should be refreshed by calling touch() again
|
||||
p.touch()
|
||||
st = p.stat()
|
||||
self.assertGreaterEqual(st.st_mtime_ns, old_mtime_ns)
|
||||
self.assertGreaterEqual(st.st_mtime, old_mtime)
|
||||
# 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)
|
||||
# Now with exist_ok=False
|
||||
p = P / 'newfileB'
|
||||
self.assertFalse(p.exists())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue