[PR #1876] tests: import fcntl where it is used so test_run_game_wine loads on Windows (TEST-RUN-GAME-WINE-WINDOWS-IMPORT) #1886

Open
opened 2026-11-26 21:19:17 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1876
Author: @fiestorra
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: carry/test-run-game-wine-windows-import


📝 Commits (1)

  • 7489dbe TEST-RUN-GAME-WINE-WINDOWS-IMPORT: import fcntl where it is used, so the file loads on Windows

📊 Changes

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

View changed files

📝 tests/test_run_game_wine.py (+4 -1)

📄 Description

Claimed in the coordination issue as: TEST-RUN-GAME-WINE-WINDOWS-IMPORT (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7164391310)

What and why

tests/test_run_game_wine.py could not be imported on Windows: import fcntl sat at module level (line 14), and the file is one of the eight that the check job's python -I loop on windows-latest runs. The class already carries @unittest.skipIf(os.name == "nt" or not shutil.which("bash"), "a POSIX bash launcher"), but the skip cannot take effect when the import fails first, so the loop stopped on this file with ModuleNotFoundError: No module named 'fcntl'.

The change moves the import into the single test that uses it (test_a_held_lock_stops_a_second_run, which locks self.lock with fcntl.flock). That test is already gated by the class-level POSIX skip, so behaviour on Linux and macOS is unchanged. No test is disabled and no assertion is loosened.

This does not turn the whole Windows job green on its own: the other seven files the loop fails are covered by #1792 (three tools' repr'd paths), #1561 (the dead test_feature_scan test and compute_heap_layout_census), #1837 and #1789 (stdout guards), and the standing claims TEST-WINE-JOBS-TIMING-WINDOWS and CI-RUNTIME-PATHS-CONFORMANCE.

Tested

Windows 11, Windows Python 3.13.14, main a73a57e1, native (no Wine, no GPU):

  • Before: python -I tests/test_run_game_wine.py -> exit 1, Traceback ... line 14, in <module> / import fcntl / ModuleNotFoundError: No module named 'fcntl'.
  • After: python -I tests/test_run_game_wine.py -> Ran 9 tests in 0.000s / OK (skipped=9), exit 0; -v lists the nine skips with the class's reason, so the file is discovered and skipped rather than silently absent.
  • python -m compileall -q tests/test_run_game_wine.py -> exit 0.
  • Linux (WSL Ubuntu, Python 3.12.3): python3 -I tests/test_run_game_wine.py -> Ran 9 tests in 0.340s / OK, no skips, so the POSIX path this change moves the import into still runs all nine tests.
  • tests/test_runner_calls_all_tests.py still reports only the pre-existing test_feature_scan.py entry (#1561), nothing about this file.
  • check-no-game-data -> the tree is clean.

Not covered: macOS. The two gate jobs (change-scope, no-game-data) are queued, as the repository's queue has been for hours; no check has started.

GPUs tested: n/a

AI-assisted: yes (DeepSeek Harness).

Checklist

  • Based on current main (a73a57e1) and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • 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. (n/a: no translator change)

Written with an AI assistant.


🔄 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/1876 **Author:** [@fiestorra](https://github.com/fiestorra) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `carry/test-run-game-wine-windows-import` --- ### 📝 Commits (1) - [`7489dbe`](https://github.com/ubiquitarianism/leonida/commit/7489dbec018c3437160e31e5e72b7701ebbeeeb8) TEST-RUN-GAME-WINE-WINDOWS-IMPORT: import fcntl where it is used, so the file loads on Windows ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_run_game_wine.py` (+4 -1) </details> ### 📄 Description Claimed in the coordination issue as: TEST-RUN-GAME-WINE-WINDOWS-IMPORT (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7164391310) ### What and why `tests/test_run_game_wine.py` could not be imported on Windows: `import fcntl` sat at module level (line 14), and the file is one of the eight that the `check` job's `python -I` loop on `windows-latest` runs. The class already carries `@unittest.skipIf(os.name == "nt" or not shutil.which("bash"), "a POSIX bash launcher")`, but the skip cannot take effect when the import fails first, so the loop stopped on this file with `ModuleNotFoundError: No module named 'fcntl'`. The change moves the import into the single test that uses it (`test_a_held_lock_stops_a_second_run`, which locks `self.lock` with `fcntl.flock`). That test is already gated by the class-level POSIX skip, so behaviour on Linux and macOS is unchanged. No test is disabled and no assertion is loosened. This does not turn the whole Windows job green on its own: the other seven files the loop fails are covered by #1792 (three tools' repr'd paths), #1561 (the dead `test_feature_scan` test and `compute_heap_layout_census`), #1837 and #1789 (stdout guards), and the standing claims TEST-WINE-JOBS-TIMING-WINDOWS and CI-RUNTIME-PATHS-CONFORMANCE. ### Tested Windows 11, Windows Python 3.13.14, `main` `a73a57e1`, native (no Wine, no GPU): - **Before:** `python -I tests/test_run_game_wine.py` -> exit 1, `Traceback ... line 14, in <module> / import fcntl / ModuleNotFoundError: No module named 'fcntl'`. - **After:** `python -I tests/test_run_game_wine.py` -> `Ran 9 tests in 0.000s / OK (skipped=9)`, exit 0; `-v` lists the nine skips with the class's reason, so the file is discovered and skipped rather than silently absent. - `python -m compileall -q tests/test_run_game_wine.py` -> exit 0. - Linux (WSL Ubuntu, Python 3.12.3): `python3 -I tests/test_run_game_wine.py` -> `Ran 9 tests in 0.340s / OK`, no skips, so the POSIX path this change moves the import into still runs all nine tests. - `tests/test_runner_calls_all_tests.py` still reports only the pre-existing `test_feature_scan.py` entry (#1561), nothing about this file. - `check-no-game-data` -> the tree is clean. Not covered: macOS. The two gate jobs (`change-scope`, `no-game-data`) are queued, as the repository's queue has been for hours; no `check` has started. GPUs tested: n/a AI-assisted: yes (DeepSeek Harness). ### Checklist - [x] Based on current `main` (`a73a57e1`) and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) Written with an AI assistant. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1886
No description provided.