mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:15:52 +01:00
[PR #10] [MERGED] tests: psocache_extract pins the temporary directory it checks against #68
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#68
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/10
Author: @wavehs
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism
Base:
main← Head:psocache-tempdir-test📝 Commits (1)
02b682dtests: psocache_extract pins the temporary directory it checks against📊 Changes
1 file changed (+8 additions, -3 deletions)
View changed files
📝
tests/test_psocache_extract.py(+8 -3)📄 Description
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.)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.