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

Manually merged
github merged 1 commit from gh-pr/90/head into gh-pr/90/base 2026-11-26 08:44:01 +00:00
Owner

@⁠wavehs on GitHub · 2026-11-24 02:15 UTC · original
wavehs:tests-win-check-no-game-data-drive → main · +7 −1 · 1 files · 1 commits · merged 2026-11-24 03:10 UTC

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.)
**@⁠wavehs** on GitHub · 2026-11-24 02:15 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/90) `wavehs:tests-win-check-no-game-data-drive` → `main` · +7 −1 · 1 files · 1 commits · merged 2026-11-24 03:10 UTC 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.)
display() reports a path relative to the working directory, but keeps the
absolute path when os.path.relpath raises ValueError - a Windows temp file on
C: with the checkout on D:. The test called relpath itself and errored out
('path is on mount C:, start on mount D:') instead of comparing the line the
tool had printed correctly.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:43:59 +00:00
github manually merged commit d411c98c8d into gh-pr/90/base 2026-11-26 08:44:01 +00:00
Author
Owner

@⁠wavehs on GitHub · 2026-11-24 02:29 UTC · original

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

**@⁠wavehs** on GitHub · 2026-11-24 02:29 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/90#issuecomment-7120194542) Rebased onto `main@e09a55529`; the diff is unchanged and `tests/test_check_no_game_data.py` is still OK here.
This discussion has been locked. Commenting is limited to contributors.
No description provided.