[PR #90] [MERGED] tests: expect the absolute path when the file is on another drive #140

Closed
opened 2026-11-26 20:16:55 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/90
Author: @wavehs
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: tests-win-check-no-game-data-drive


📝 Commits (1)

  • d411c98 tests: expect the absolute path when the file is on another drive

📊 Changes

1 file changed (+7 additions, -1 deletions)

View changed files

📝 tests/test_check_no_game_data.py (+7 -1)

📄 Description

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.)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/90 **Author:** [@wavehs](https://github.com/wavehs) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `tests-win-check-no-game-data-drive` --- ### 📝 Commits (1) - [`d411c98`](https://github.com/ubiquitarianism/leonida/commit/d411c98c8d9f87d4a61dae4f1ddec2329a12578a) tests: expect the absolute path when the file is on another drive ### 📊 Changes **1 file changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_check_no_game_data.py` (+7 -1) </details> ### 📄 Description 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.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:16:55 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#140
No description provided.