Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-auchincloss committed Apr 28, 2024
1 parent ced23fc commit df02a23
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ def new_tmp_dir(tmp_path):
def test_stale(new_tmp_dir):
src = new_tmp_dir / "test.txt"
dest = new_tmp_dir / "dest.txt"

src.write_text("hello world")
dest.write_text("hello world")

# mtime may not be within resolution to run tests consistently, so we need to wait for sys
# to reflect the modification times
# https://stackoverflow.com/questions/19059877/python-os-path-getmtime-time-not-changing
sleep(5)

dest.write_text("hello world")

sleep(5)

assert not stale(
str(src),
str(dest),
Expand Down

0 comments on commit df02a23

Please sign in to comment.