kimi-cli
kimi-cli copied to clipboard
fix(tests): improve Windows cross-platform test compatibility
Related Issue
N/A (small fix < 100 lines; no prior issue required per CONTRIBUTING.md)
Description
Two Windows cross-platform issues in the test suite:
-
test_background_tools.py:Path.write_text()withoutnewline=""converts\nto\r\non Windows, causinglast_seen_output_sizeassertions to fail (28 bytes vs expected 26 bytes). -
tests/e2e/: Unconditionalimport fcntlat module level causesModuleNotFoundErrorduring test collection on Windows, sincefcntl,termios, andptyare Unix-only modules.
Changes
- Added
newline=""towrite_text()calls in test helpers_write_task()and_write_agent_task()to ensure consistent byte lengths across platforms. - Created
tests/e2e/conftest.pywithcollect_ignore_globto skip PTY-based e2e tests on Windows.
Note: CI currently only runs tests on Ubuntu, so these issues were not caught previously. These fixes enable local development and testing on Windows without false failures.
Checklist
- [x] I have read the CONTRIBUTING document.
- [x] I have linked the related issue, if any.
- [x] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have run
make gen-changelogto update the changelog. - [ ] I have run
make gen-docsto update the user documentation.