[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
7ec9e77a5d
commit
499bada598
3 changed files with 9 additions and 6 deletions
|
|
@ -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():
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue