tests: psocache_extract pins the temporary directory it checks against #10
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-24T01:31:26Z.
Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository has no such issue yet. No open pull request touches
tests/test_psocache_extract.py.Depends on: none.
What and why
test_output_outside_the_temp_directory_is_refusedexpectspsocache_extract.pyto refuse an output path in the repository root, but the tool compares that path with the system temporary directory. A checkout that lives under/tmpor%TEMP%— the usual sandbox worktree — makes the repository itself "inside" it, the tool writes the cache there and the test fails with0 != 2(and leaves the file behind).The tool is right; the test's environment is not pinned. It now runs the tool with
TMPDIRset to a fresh directory, so the refusal holds wherever the tree lives, and removes the output path in a cleanup either way.Tested
main@30daa6958, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files, checkout under$TMPDIR:tests/test_psocache_extract.pymain@30daa6958FAILED (failures=1):0 != 2intest_output_outside_the_temp_directory_is_refusedRan 7 tests ... OKcompileallclean,check_no_game_data.pyclean. On a checkout outside the temporary directory the old test passes and this one still does (TMPDIR is only changed for this subprocess).AI-assisted: yes.
Checklist
docs/design.md, with how it was confirmed. (Not applicable: no translator change.)