mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-14 19:17:32 +08:00
Two robustness fixes to the workflow_id regression tests:
1. Resolve source-file paths relative to __file__ (repo_root =
Path(__file__).resolve().parents[2]) instead of bare
Path("main.py"). The bare form depends on the process CWD being the
repo root, which made the tests flaky when run from tests-unit/, an
IDE runner, or any other directory. Verified passing from three
different CWDs (repo root, tests-unit/, /tmp).
2. Track matched_terminal_executing_send and assert it after the AST
walk in TestTerminalExecutingResetInMainPy. Previously, if someone
refactored the send_sync("executing", {...}) call to pass a local
variable instead of an inline dict literal, the loop would simply
find no match and the test would pass vacuously, losing its
regression-protection value. Verified by temporarily refactoring
main.py to use a variable payload: the test now fails with a clear
message asking to update the regression test, and passes again once
the inline dict is restored.
|
||
|---|---|---|
| .. | ||
| 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 | ||
| 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/