Stub diffusers.hooks too in the no-diffusers cache test

This commit is contained in:
Daniel Han 2026-07-05 02:04:16 +00:00
commit 25d9cf9604

View file

@ -166,7 +166,10 @@ def test_missing_transformer_is_none(monkeypatch):
def test_diffusers_unavailable_runs_uncached(monkeypatch):
# no diffusers import -> best-effort returns None, load proceeds uncached.
# no diffusers import -> best-effort returns None, load proceeds uncached. Block the
# hooks module too: the config import falls back to diffusers.hooks, which a REAL
# earlier import in the test session may have left cached in sys.modules.
monkeypatch.setitem(sys.modules, "diffusers", None)
monkeypatch.setitem(sys.modules, "diffusers.hooks", None)
t = _MixinTransformer()
assert apply_step_cache(_pipe(t), mode = "fbcache") is None