mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:25:53 +01:00
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#2106
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/2101
Author: @Boost9898
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/calibrated-texture-replace-cleanup📝 Commits (1)
4cfb025test_calibrated_texture_extra: patch the replace_retry that calibrated_texture holds📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
tests/test_calibrated_texture_extra.py(+1 -1)📄 Description
Claimed in the coordination issue as: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7174081616
What and why
#570 added
test_export_file_replacement_failure_cleans_temporary_filetotests/test_calibrated_texture_extra.py. It fails onmaindb1a22d29wherever numpy isn't installed (OSError not raised).Without numpy,
_load_calibrated_texture()runscalibrated_texture.pyinsidemock.patch.dict(sys.modules, {"numpy": fake_np}). On exit,patch.dictrestoressys.modules, which also removesreplace_retry, imported during that load. The test patchesmock.patch("replace_retry.replace", ...), which imports and patches a fresh copy ofreplace_retry.ct.replace_retryis still the old one, soexport_filereplaces the file normally and nothing raises. Checked: with the fake numpy,ct.replace_retry is sys.modules["replace_retry"]isFalse.The test now patches
mock.patch.object(ct.replace_retry, "replace", ...), which is the moduleexport_filecalls, with or without numpy.tools/calibrated_texture.pyis unchanged.Tested
Apple M4, macOS 26.5.1, Python 3.14.8 and 3.12.10 (neither has numpy, so the stdlib shim path is used), CPU only, no game files.
tests/test_calibrated_texture_extra.py: the test fails onmaindb1a22d29. With this change, all 30 tests OK on both versions.tmp.unlink(...)cleanup inexport_fileremoved, the test fails again, so it still checks the cleanup.python -m compileall,git diff --checkandscripts/check_no_game_data.pyon the changed file: clean.GPUs tested: n/a (no GPU tests involved)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator rule changes)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.