[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-05-25 00:34:01 +00:00
commit 18b50c1f8a

View file

@ -439,8 +439,10 @@ def test_failed_swap_clears_previous_metadata(monkeypatch):
# Replace from_pretrained on the SAME fake module with a raising one
# without re-installing the rest of the fakes.
fake = sys.modules["diffusers"]
def _boom(cls, *a, **kw):
raise RuntimeError("simulated swap failure")
fake.Flux2KleinPipeline.from_pretrained = classmethod(_boom)
with pytest.raises(RuntimeError, match = "Failed to load diffusion model"):