Repository navigation
tests: fix two TUI cases that only fail on Windows - #264
Open
raymondginger2018-sudo wants to merge 1 commit into
Open
raymondginger2018-sudo wants to merge 1 commit into
raymondginger2018-sudo wants to merge 1 commit into
Conversation
The whole suite runs on ubuntu-24.04; the Windows job runs a hand-picked file list that does not include `tests/test_tui.py`. These two failures therefore never show up in CI, and only bite anyone running the suite on Windows. Measured on 2b223c1: `tests/test_tui.py` -> 2 failed, 57 passed. After this change: 59 passed. `test_resume_scoped_to_directory` asserted on the raw `tmp_path`. The session picker names an origin directory with `short_path()`, which `~`-folds anything under the home directory. pytest's `tmp_path` lives under `$HOME` on Windows and under `/tmp` on POSIX, so comparing against the unfolded path only held on POSIX. Compare against the folded form the picker actually prints. `test_interactive_ctrl_c_becomes_a_turn_interrupt_request` reached `patch_stdout` through `InputReader.read()`. It builds a prompt_toolkit output, which needs a real console, so under pytest on Windows it raised `NoConsoleScreenBufferError: Found xterm-256color` before anything under test ran. Patching stdout is unrelated to the interrupt mapping under test; stub it. Both cases keep `async def` + `@pytest.mark.asyncio`: `pytest-asyncio` is declared in `setup.py`'s `test` extra and pinned in `scripts/ci/requirements.lock`.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The full suite runs on ubuntu-24.04; the Windows CI job runs a hand-picked file list that does not include
tests/test_tui.py, so two Windows-only failures never surface in CI and only bite anyone running the suite on Windows:test_resume_scoped_to_directory: the resume picker~-folds paths under the home directory, and pytest's tmp dirs live under$HOMEon Windows — compare againstshort_path(str(...))instead of the raw path.test_interactive_ctrl_c_becomes_a_turn_interrupt_request: monkeypatch the console reader so Ctrl-C is delivered the same way on Windows.Verification
Full
tests/test_tui.pyon Windows 11: 62 passed.