ComfyUI/tests-unit
Glary-Bot 1f0b13705d Address review: clear stale workflow_id, expand reconnect payload, harden tests
- Clear self.server.last_workflow_id and self.workflow_id in the
  PromptExecutor finally block so a progress callback racing with
  teardown can no longer attach the previous run's workflow_id to a
  later 'progress' event.
- Include prompt_id and last_workflow_id in the reconnect 'executing'
  message in server.py so reconnecting clients can recover both
  workflow- and prompt-scoped execution state, matching the regular
  'executing' payload.
- Add an AST-based static guard that walks execution.py, main.py, and
  comfy_execution/progress.py and asserts every dict literal carrying
  prompt_id also carries workflow_id. Also add a unit test covering
  PREVIEW_IMAGE_WITH_METADATA metadata. Together these regression-test
  every emitter (execution_start/success/error/interrupted/cached,
  executing, executed, progress, progress_state, preview metadata)
  without requiring a GPU-backed import of execution.py.
2026-05-02 02:39:30 +00:00
..

Pytest Unit Tests

Install test dependencies

pip install -r tests-unit/requirements.txt

Run tests

pytest tests-unit/