mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-08 00:02:31 +08:00
Per @guill review on PR #13425: add tests covering Windows-style line endings, since editors often save files with CRLF and we want to confirm the CR never leaks into the returned value. - `_write_env_file` now opens with `newline=""` so the on-disk bytes match the literal string passed in (deterministic across host OSes, no `\n` -> `\r\n` translation on Windows). New tests: - `test_crlf_line_ending`: `"...\r\n"` -> value (no trailing CR). - `test_crlf_multiline_only_first_line_used`: `readline(128)` stops at the translated newline boundary for CRLF lines. - `test_crlf_with_surrounding_whitespace`: leading/trailing spaces + CRLF still yield the bare value. - `test_lone_cr_line_ending`: classic-Mac / legacy editor `"...\r"` is also handled by universal-newlines decoding. 15/15 unit tests pass. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019df5a8-36be-7107-a4af-c7e4f51687df |
||
|---|---|---|
| .. | ||
| app_test | ||
| assets_test | ||
| comfy_api_test | ||
| comfy_extras_test | ||
| comfy_quant | ||
| comfy_test | ||
| execution_test | ||
| folder_paths_test | ||
| prompt_server_test | ||
| seeder_test | ||
| server/utils | ||
| server_test | ||
| utils | ||
| deploy_environment_test.py | ||
| feature_flags_test.py | ||
| README.md | ||
| requirements.txt | ||
| websocket_feature_flags_test.py | ||
Pytest Unit Tests
Install test dependencies
pip install -r tests-unit/requirements.txt
Run tests
pytest tests-unit/