mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-06 05:17:15 +00:00
test(scratch): os.utime follow_symlinks is POSIX-only — guard it so the worktree test can age its tree on Windows too
This commit is contained in:
1 parent
36bbacd0fa
commit
fd74c42e54
1 file changed
+5
-1
@@ -381,7 +381,11 @@ def test_prune_releases_git_worktree_registration_of_idle_entry(tmp_path):
|
||||
ancient = time.time() - 30 * 3600
|
||||
for dirpath, dirnames, filenames in os.walk(tree.parent):
|
||||
for name in dirnames + filenames:
|
||||
os.utime(os.path.join(dirpath, name), (ancient, ancient), follow_symlinks=False)
|
||||
try:
|
||||
os.utime(os.path.join(dirpath, name), (ancient, ancient), follow_symlinks=False)
|
||||
except NotImplementedError:
|
||||
# Windows: os.utime has no follow_symlinks parameter.
|
||||
os.utime(os.path.join(dirpath, name), (ancient, ancient))
|
||||
os.utime(tree.parent, (ancient, ancient))
|
||||
assert prune_scratch_dir(scratch) == 1
|
||||
listing = subprocess.run(["git", "worktree", "list", "--porcelain"], cwd=repo, capture_output=True,
|
||||
|
||||
Reference in new issue
Block a user