Add session-mode code generation that produces a reusable WorkflowSession class instead of a simple oneshot script. The session mode generates code with an in-class run/close lifecycle for warm ComfyUI reuse. Also refactors render.py to extract shared code sections into common methods, reducing duplication between oneshot and session renderers. Adds WorkflowSessionRuntime with cleanup policies (per_run, session, manual) and reset_every_n_runs support, plus 72 new tests covering session rendering, runtime session, and session export pipeline.
17 lines
478 B
Python
17 lines
478 B
Python
"""Pytest configuration to handle the ComfyUI extension __init__.py at repo root."""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def _setup_test_path():
|
|
"""Ensure the package is importable during tests."""
|
|
# Add the repo root to sys.path so `from comfyui_to_python import ...` works
|
|
repo_root = Path(__file__).parent.parent.resolve()
|
|
if str(repo_root) not in sys.path:
|
|
sys.path.insert(0, str(repo_root))
|
|
yield
|