From b0883b791f95a595fae70bcedf3ad0f73c00e258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Valur=20J=C3=B3nsson?= Date: Thu, 29 Sep 2022 13:37:55 +0000 Subject: Simplify async timeouts and allowing `timeout=None` in `PubSub.get_message()` to wait forever (#2295) * Avoid an extra "can_read" call and use timeout directly. * Remove low-level read timeouts from the Parser, now handled in the Connection * Allow pubsub.get_message(time=None) to block. * update Changes * increase test timeout for robustness * expand with statement to avoid invoking null context managers. remove nullcontext * Remove unused import --- tests/test_asyncio/test_pubsub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_asyncio/test_pubsub.py b/tests/test_asyncio/test_pubsub.py index 86584e4..6dedca9 100644 --- a/tests/test_asyncio/test_pubsub.py +++ b/tests/test_asyncio/test_pubsub.py @@ -29,7 +29,7 @@ def with_timeout(t): return wrapper -async def wait_for_message(pubsub, timeout=0.1, ignore_subscribe_messages=False): +async def wait_for_message(pubsub, timeout=0.2, ignore_subscribe_messages=False): now = asyncio.get_event_loop().time() timeout = now + timeout while now < timeout: -- cgit v1.2.1