Skip to content

Commit 0940383

Browse files
committed
added more sleeps to ensure mtimes of input files are different in tests
1 parent a9fd6e1 commit 0940383

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pydra/engine/tests/test_specs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def test_input_file_hash_2(tmp_path):
195195
assert hash1 == hash2
196196

197197
# checking if different content (the same name) affects the hash
198+
time.sleep(2) # ensure mtime is different
198199
file_diffcontent = tmp_path / "in_file_1.txt"
199200
with open(file_diffcontent, "w") as f:
200201
f.write("hi")
@@ -225,6 +226,7 @@ def test_input_file_hash_2a(tmp_path):
225226
assert hash1 == hash2
226227

227228
# checking if different content (the same name) affects the hash
229+
time.sleep(2) # ensure mtime is different
228230
file_diffcontent = tmp_path / "in_file_1.txt"
229231
with open(file_diffcontent, "w") as f:
230232
f.write("hi")
@@ -266,6 +268,7 @@ def test_input_file_hash_3(tmp_path):
266268
# assert id(files_hash1["in_file"][filename]) == id(files_hash2["in_file"][filename])
267269

268270
# recreating the file
271+
time.sleep(2) # ensure mtime is different
269272
with open(file, "w") as f:
270273
f.write("hello")
271274

@@ -357,6 +360,7 @@ def test_input_file_hash_5(tmp_path):
357360
assert hash1 == hash2
358361

359362
# checking if different content (the same name) affects the hash
363+
time.sleep(2) # ensure mtime is different
360364
file_diffcontent = tmp_path / "in_file_1.txt"
361365
with open(file_diffcontent, "w") as f:
362366
f.write("hi")

0 commit comments

Comments
 (0)