Skip to content

Commit df1fec2

Browse files
committed
style:
1 parent 0ecf1c8 commit df1fec2

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

tests/test_worker.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,12 +2038,7 @@ def test_cache_hit_bumps_mtime_for_true_lru(self, tmp_data_dir):
20382038
_Image.new("RGB", (2, 2)).save(_buf, format="WEBP")
20392039
cache_file.write_bytes(_buf.getvalue())
20402040

2041-
# Backdate mtime so we can detect a bump.
2042-
# Use 7200s (2 hours) rather than exactly 3600s: the bump guard in
2043-
# image_shrink uses `> 3600`, and on Windows time.time() has ~15ms
2044-
# resolution, so the test setup and shrink()'s internal now= call can
2045-
# land in the same timer tick, making the difference exactly 3600 and
2046-
# failing the strict > check. 2 hours clears the boundary with margin.
2041+
# Backdate mtime so we can detect a bump; 7200s (not exactly 3600) because the bump guard uses `> 3600` and Windows time.time() has ~15ms resolution — both calls can land in the same tick, making the diff exactly 3600 and failing the strict check.
20472042
old_ts = time.time() - 7200 # 2 hours ago
20482043
os.utime(cache_file, (old_ts, old_ts))
20492044
assert cache_file.stat().st_mtime == pytest.approx(old_ts, abs=1.0)

0 commit comments

Comments
 (0)