summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-11-23 01:11:02 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-11-23 01:11:02 (GMT)
commit12820c0d5d6b3ccbd191703d1003794ddb1bcac9 (patch)
tree660ed2770a578098aff79181924905b94a8bddf8 /Lib/test
parentc3055be5f30a4b980356322e11a3d8e119059dbe (diff)
downloadcpython-12820c0d5d6b3ccbd191703d1003794ddb1bcac9.zip
cpython-12820c0d5d6b3ccbd191703d1003794ddb1bcac9.tar.gz
cpython-12820c0d5d6b3ccbd191703d1003794ddb1bcac9.tar.bz2
Revert utime(..., None) strategy (it has too poor resolution under Windows) and restore the previous test workaround
(issue #19715)
Diffstat (limited to 'Lib/test')
-rwxr-xr-xLib/test/test_pathlib.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index 049e12d..6663ffa 100755
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -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())