Skip to content

Fixed watch server tests on Windows - #1393

Merged
david-yz-liu merged 1 commit into
masterfrom
fix-failing-watch-tests
Sep 21, 2026
Merged

david-yz-liu merged 1 commit into
masterfrom
fix-failing-watch-tests

Conversation

@david-yz-liu

@david-yz-liu david-yz-liu commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Proposed Changes

(Describe your changes here. Also describe the motivation for your changes: what problem do they solve, or how do they improve the application or codebase? If this pull request fixes an open issue, use a keyword to link this pull request to the issue.)

This PR fixes two tests in test_check.py (test_check_watch_enabled, test_watch_output_file_appends) that were failing on Windows. There are three fixes:

  1. On Windows, select.select only support sockets and not pipe file objects like process.stdout/process.stderr. The tests were switched to using daemon threads to read from the process streams and write to a queue.
  2. reset_watch_fixture()/modify_watch_fixture() build a throwaway Python script by embedding a raw path into an f-string: output="{output_path}". On Windows, paths contain backslashes (e.g. C:\Users\... which were SyntaxErrors in the script. This was fixed by using repr() to escape the path: output={output_path!r}.
  3. On Windows, when stdout is redirected/piped, Python defaults to the system codebase (e.g. cp1252). This failed to encode characters like ‾, which the PlainReporter uses to underline parts of the error message. This was fixed by setting the output stream encoding to UTF-8 across all reporters.
Screenshots of your changes (if applicable)

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
✨ New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue) X
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests) X
📚 Documentation update (change that only updates documentation)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • I have updated the project Changelog (this is required for all changes).
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

(Include any questions or comments you have regarding your changes.)

@coveralls

coveralls commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 35550437941

Coverage increased (+0.004%) to 90.882%

Details

  • Coverage increased (+0.004%) from the base build.
  • Patch coverage: 2 of 2 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4091
Covered Lines: 3718
Line Coverage: 90.88%
Coverage Strength: 17.66 hits per line

💛 - Coveralls

@david-yz-liu
david-yz-liu force-pushed the fix-failing-watch-tests branch from f737d54 to 4dfb819 Compare September 21, 2026 01:17
@david-yz-liu
david-yz-liu merged commit 2e369c3 into master Sep 21, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants