Skip to content

Commit

Permalink
added more sleeps to ensure mtimes of input files are different in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Sep 25, 2023
1 parent d8a7f70 commit 1c1c309
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pydra/engine/tests/test_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def test_input_file_hash_2(tmp_path):
assert hash1 == hash2

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

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

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

Expand Down Expand Up @@ -357,6 +360,7 @@ def test_input_file_hash_5(tmp_path):
assert hash1 == hash2

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

0 comments on commit 1c1c309

Please sign in to comment.