mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-03-22 22:30:45 -07:00
Quality tests fail during collection because test_processing_runner imports modules.processing at module level, which triggers sd_samplers before shared.opts is initialized. Defer import to inside test and add initialize fixture so webui/opts are loaded first. Made-with: Cursor
27 lines
706 B
Python
27 lines
706 B
Python
"""Contract tests for ProcessingRunner (M10 runner skeleton)."""
|
|
from modules.runtime.runner import ProcessingRunner, ProcessingRequest
|
|
|
|
|
|
def test_processing_runner_delegates(monkeypatch, initialize):
|
|
"""ProcessingRunner.run delegates to process_images_inner."""
|
|
import modules.processing
|
|
|
|
called = {}
|
|
|
|
def fake_process_images_inner(p):
|
|
called["ok"] = True
|
|
return "result"
|
|
|
|
monkeypatch.setattr(
|
|
modules.processing,
|
|
"process_images_inner",
|
|
fake_process_images_inner,
|
|
)
|
|
|
|
runner = ProcessingRunner()
|
|
request = ProcessingRequest(processing="dummy")
|
|
|
|
result = runner.run(request)
|
|
|
|
assert called["ok"]
|
|
assert result == "result"
|