Mock streaming prep sleep in tests

- add an autouse fixture that patches stream-prep sleep to a no-op
- keep the polling branches covered while removing the long test delay
This commit is contained in:
Antti Kettunen 2026-04-30 21:26:28 +03:00
parent c97a072f54
commit 761fc29523
No known key found for this signature in database
GPG key ID: C6B2A3D250359BD7

View file

@ -26,6 +26,12 @@ class _FakeSoulseek:
return True
@pytest.fixture(autouse=True)
def _no_sleep(monkeypatch):
"""Keep stream-prep tests fast while still exercising the polling branches."""
monkeypatch.setattr(sp.time, 'sleep', lambda *_args, **_kwargs: None)
def _build_deps(
*,
state=None,