Add autouse fixture to patch asyncio.sleep (#1131)

This commit is contained in:
Steven B.
2024-09-27 10:57:23 +01:00
committed by GitHub
parent 038b6993ca
commit db686e191a
2 changed files with 13 additions and 3 deletions

View File

@@ -66,8 +66,6 @@ async def test_protocol_retries_via_client_session(
):
host = "127.0.0.1"
conn = mocker.patch.object(aiohttp.ClientSession, "post", side_effect=error)
mocker.patch.object(protocol_class, "BACKOFF_SECONDS_AFTER_TIMEOUT", 0)
mocker.patch("asyncio.sleep")
config = DeviceConfig(host)
with pytest.raises(KasaException):
@@ -140,7 +138,6 @@ async def test_protocol_retry_recoverable_error(
"post",
side_effect=aiohttp.ClientOSError("foo"),
)
mocker.patch("asyncio.sleep")
config = DeviceConfig(host)
with pytest.raises(KasaException):