From 1c83675e57ce5c3ef9ab610d2aadbfd9bc520dac Mon Sep 17 00:00:00 2001 From: "Steven B." <51370195+sdb9696@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:58:37 +0100 Subject: [PATCH] Fix intermittently failing decryption error test (#1082) --- kasa/tests/test_klapprotocol.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kasa/tests/test_klapprotocol.py b/kasa/tests/test_klapprotocol.py index 0565683a..4a7b3e18 100644 --- a/kasa/tests/test_klapprotocol.py +++ b/kasa/tests/test_klapprotocol.py @@ -1,5 +1,6 @@ import json import logging +import re import secrets import time from contextlib import nullcontext as does_not_raise @@ -298,7 +299,7 @@ async def test_transport_decrypt_error(mocker, caplog): with pytest.raises( KasaException, - match="Error trying to decrypt device 127.0.0.1 response: Invalid padding bytes.", + match=re.escape("Error trying to decrypt device 127.0.0.1 response:"), ): await transport.send(json.dumps({}))