mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Try to debug issue #19715
This commit is contained in:
parent
2dd38fb238
commit
0f57564cac
1 changed files with 6 additions and 2 deletions
|
@ -1382,13 +1382,17 @@ class _BasePathTest(object):
|
|||
self.assertFalse(p.exists())
|
||||
p.touch()
|
||||
self.assertTrue(p.exists())
|
||||
old_mtime = p.stat().st_mtime
|
||||
st = p.stat()
|
||||
old_mtime = st.st_mtime
|
||||
old_mtime_ns = st.st_mtime_ns
|
||||
# Rewind the mtime sufficiently far in the past to work around
|
||||
# filesystem-specific timestamp granularity.
|
||||
os.utime(str(p), (old_mtime - 10, old_mtime - 10))
|
||||
# The file mtime is refreshed by calling touch() again
|
||||
p.touch()
|
||||
self.assertGreaterEqual(p.stat().st_mtime, old_mtime)
|
||||
st = p.stat()
|
||||
self.assertGreaterEqual(st.st_mtime_ns, old_mtime_ns)
|
||||
self.assertGreaterEqual(st.st_mtime, old_mtime)
|
||||
p = P / 'newfileB'
|
||||
self.assertFalse(p.exists())
|
||||
p.touch(mode=0o700, exist_ok=False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue