tests: expect the absolute path when the file is on another drive #90

Merged
wavehs merged 1 commit from upstream-pr/90 into main 2026-11-24 03:10:05 +00:00
wavehs commented 2026-11-24 02:15:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-24T02:15:52Z.


Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository's issue index (#18) has no entry for it. No open pull request touches this file.

Depends on: none.

What and why

tests/test_check_no_game_data.py is one of the Windows check job's errors:

ERROR: test_unreadable_file_is_one_stderr_line_and_exit_2
  File "tests/test_check_no_game_data.py", line 291, in test_unreadable_file_is_one_stderr_line_and_exit_2
    self.assertEqual(out.splitlines(), [f"{os.path.relpath(sibling)}: DDS texture"], out)
ValueError: path is on mount 'C:', start on mount 'D:'

The script itself handles this: display() (scripts/check_no_game_data.py:281) reports the path relative to the working directory and keeps the absolute path when os.path.relpath raises — which is what happens when a Windows temp file is on C: and the checkout is on D:. The test did not have that fallback and errored before comparing anything. It now expects the same path the tool prints.

Tested

macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files:

tree tests/test_check_no_game_data.py
main@9ec34cdff OK (POSIX: relpath never crosses a drive)
this commit OK

The Windows behaviour of the two path functions is checked with ntpath directly: ntpath.relpath("C:\Temp\sibling.bin", "D:\a\leonida") raises ValueError: path is on mount 'C:', start on mount 'D:', which is the message in the CI log, and the fallback then keeps the absolute path — the line the script prints. Not run on Windows itself.

compileall clean, check_no_game_data.py clean.

AI-assisted: yes.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: test-only.)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5464803379 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/90). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-24T02:15:52Z. --- Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository's issue index (#18) has no entry for it. No open pull request touches this file. Depends on: none. ### What and why `tests/test_check_no_game_data.py` is one of the Windows `check` job's errors: ``` ERROR: test_unreadable_file_is_one_stderr_line_and_exit_2 File "tests/test_check_no_game_data.py", line 291, in test_unreadable_file_is_one_stderr_line_and_exit_2 self.assertEqual(out.splitlines(), [f"{os.path.relpath(sibling)}: DDS texture"], out) ValueError: path is on mount 'C:', start on mount 'D:' ``` The script itself handles this: `display()` (`scripts/check_no_game_data.py:281`) reports the path relative to the working directory and keeps the absolute path when `os.path.relpath` raises — which is what happens when a Windows temp file is on `C:` and the checkout is on `D:`. The test did not have that fallback and errored before comparing anything. It now expects the same path the tool prints. ### Tested macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files: | tree | `tests/test_check_no_game_data.py` | |---|---| | `main@9ec34cdff` | `OK` (POSIX: relpath never crosses a drive) | | this commit | `OK` | The Windows behaviour of the two path functions is checked with `ntpath` directly: `ntpath.relpath("C:\Temp\sibling.bin", "D:\a\leonida")` raises `ValueError: path is on mount 'C:', start on mount 'D:'`, which is the message in the CI log, and the fallback then keeps the absolute path — the line the script prints. Not run on Windows itself. `compileall` clean, `check_no_game_data.py` clean. AI-assisted: yes. ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (Not applicable: test-only.)
wavehs commented 2026-11-24 02:29:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-24T02:29:20Z.


Rebased onto main@e09a55529; the diff is unchanged and tests/test_check_no_game_data.py is still OK here.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7120194542 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/90#issuecomment-7120194542). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-24T02:29:20Z. --- Rebased onto `main@e09a55529`; the diff is unchanged and `tests/test_check_no_game_data.py` is still OK here.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!90
No description provided.