From 0eb6653595cf7ce762070b99e2788482d9386c27 Mon Sep 17 00:00:00 2001 From: Sandor Kertesz Date: Mon, 4 Dec 2023 16:52:13 +0000 Subject: [PATCH] Fix test cache_zip_file_changed_modtime (#270) --- tests/core/test_cache.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/core/test_cache.py b/tests/core/test_cache.py index 67842a17..9c763679 100644 --- a/tests/core/test_cache.py +++ b/tests/core/test_cache.py @@ -252,9 +252,9 @@ def test_cache_zip_file_changed_modtime(): ds_path = ds.path # second pass - changed modtime - # TODO: here we have to assume more than 1 ns passed since the - # zip file was created. - os.utime(zip_path, None) + st = os.stat(zip_path) + m_time = (st.st_atime_ns + 10, st.st_mtime_ns + 10) + os.utime(zip_path, ns=m_time) ds2 = from_source("file", zip_path) assert len(ds2) == 2 assert ds2.path != ds_path