From 761fc29523671ef7e2889c3a64f03527271cb1d6 Mon Sep 17 00:00:00 2001 From: Antti Kettunen Date: Thu, 30 Apr 2026 21:26:28 +0300 Subject: [PATCH] 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 --- tests/streaming/test_prepare.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/streaming/test_prepare.py b/tests/streaming/test_prepare.py index 2b7c541b..cfe3c277 100644 --- a/tests/streaming/test_prepare.py +++ b/tests/streaming/test_prepare.py @@ -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,