Skip to content

Commit c2b6a79

Browse files
committed
test(namespace): ensure mtime differs on coarse resolution filesystems
1 parent edaea47 commit c2b6a79

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/robotcode/robot/diagnostics/test_namespace_cache.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,9 @@ def test_source_mtime_changed_fails(self, tmp_path: Path) -> None:
342342

343343
# Modify the file → mtime changes
344344
source.write_text("modified content!")
345+
# Ensure mtime differs even on filesystems with coarse resolution (e.g. Windows NTFS)
346+
stat = source.stat()
347+
os.utime(source, ns=(stat.st_atime_ns + 1_000_000_000, stat.st_mtime_ns + 1_000_000_000))
345348
assert ImportsManager.validate_namespace_meta(im, meta) is False
346349

347350
def test_source_deleted_fails(self, tmp_path: Path) -> None:

0 commit comments

Comments
 (0)