[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-07-13 01:23:42 +00:00
commit 499bada598
3 changed files with 9 additions and 6 deletions

View file

@ -3030,8 +3030,8 @@ def test_unload_waits_for_in_flight_denoise_before_teardown():
with backend._generate_lock:
denoise_active["v"] = True
started.set()
cancel.wait(2.0) # unload signals this
finish.wait(2.0) # the test lets us finish
cancel.wait(2.0) # unload signals this
finish.wait(2.0) # the test lets us finish
denoise_active["v"] = False # about to release _generate_lock
def _fake_unload_locked():

View file

@ -258,9 +258,7 @@ def test_activate_serializes_switch_and_concurrent_query(monkeypatch):
unload_started.set()
release_unload.wait(2.0)
engine = SimpleNamespace(
status = lambda: {"loaded": False, "repo_id": None}, unload = _slow_unload
)
engine = SimpleNamespace(status = lambda: {"loaded": False, "repo_id": None}, unload = _slow_unload)
monkeypatch.setattr(r, "get_active_diffusion_engine", lambda: engine)
switch_done = threading.Event()

View file

@ -180,7 +180,12 @@ def client(monkeypatch, tmp_path):
monkeypatch.setattr(gallery_module, "save", _save)
monkeypatch.setattr(gallery_module, "image_b64", lambda i: "QUJD" if i in store else None)
def _list_images(limit = None, offset = 0, *, valid = None):
def _list_images(
limit = None,
offset = 0,
*,
valid = None,
):
ordered = sorted(store.values(), key = lambda r: r.get("created_at", 0.0), reverse = True)
if valid is not None:
ordered = [r for r in ordered if valid(r)]