Repository navigation
test: fix the remaining Windows test failures - #36
Merged
Merged
Conversation
Read cli/main.py as UTF-8 (cp1252 is the Windows default and cannot decode it), and use a wide console in the output fixture so a long Windows temp path does not wrap the sentence being asserted on. Also reset the StringIO properly: truncate(0) alone left the write position and padded output with NULs.
The test patched subprocess.Popen globally, so the taskkill call run_shell makes during cleanup on Windows was interrupted too and the child was left running. Interrupt only the command under test.
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.
Follow-up to #30, which was merged before these last two commits landed. They only change tests; after #30 the Windows jobs had exactly three failures left, all understood from the CI logs:
test_every_slash_command_in_the_dropdown_has_a_handler:read_text()without an encoding uses cp1252 on Windows and cannot decodecli/main.py. Now reads UTF-8test_trust_declined_then_accepted_then_revoked: the long Windows temp path made rich wrapwas \nnot trusted. The output fixture now uses a very wide console, and resets its StringIO properly (truncate(0)withoutseek(0)padded output with NULs)test_keyboard_interrupt_kills_the_child_and_propagates: the test patchedsubprocess.Popenglobally, so thetaskkillcall thatrun_shellmakes during cleanup on Windows was interrupted too and the child was left running. Only the command under test is interrupted nowThe process-tree kill itself is verified on Windows by #30's passing
test_timeout_*and hooks tests.Verified locally (Linux, HOME redirected): suite passes. Windows jobs on this PR are the real check.