From cabd7538359c811dbc7c29ba76c0e58a062fdd81 Mon Sep 17 00:00:00 2001 From: Xavier Chapron Date: Thu, 7 Dec 2023 14:41:55 +0100 Subject: [PATCH] tests: Fix exception type not handled --- tests/speculos/u2f/test_u2f_fake_channel_security_crc.py | 3 ++- tests/speculos/u2f/test_u2f_fake_channel_security_length.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/speculos/u2f/test_u2f_fake_channel_security_crc.py b/tests/speculos/u2f/test_u2f_fake_channel_security_crc.py index ac1e13f3..96760c5c 100644 --- a/tests/speculos/u2f/test_u2f_fake_channel_security_crc.py +++ b/tests/speculos/u2f/test_u2f_fake_channel_security_crc.py @@ -1,4 +1,5 @@ import pytest +import socket from fido2.ctap1 import ApduError, Ctap1 from fido2.hid import CTAPHID @@ -43,5 +44,5 @@ def test_register_raw_u2f_fake_channel_security_crc(client): p2=0x00, data=data) - with pytest.raises((AssertionError, ConnectionResetError, TimeoutError)) as e: + with pytest.raises((AssertionError, ConnectionResetError, TimeoutError, socket.timeout)) as e: response = client.ctap1.device.recv(CTAPHID.MSG) diff --git a/tests/speculos/u2f/test_u2f_fake_channel_security_length.py b/tests/speculos/u2f/test_u2f_fake_channel_security_length.py index 8e8a5247..e0cfb475 100644 --- a/tests/speculos/u2f/test_u2f_fake_channel_security_length.py +++ b/tests/speculos/u2f/test_u2f_fake_channel_security_length.py @@ -1,4 +1,5 @@ import pytest +import socket from fido2.ctap1 import ApduError, Ctap1 from fido2.hid import CTAPHID @@ -44,5 +45,5 @@ def test_register_raw_u2f_fake_channel_security_length(client): p2=0x00, data=data) - with pytest.raises((AssertionError, ConnectionResetError, TimeoutError)) as e: + with pytest.raises((AssertionError, ConnectionResetError, TimeoutError, socket.timeout)) as e: response = client.ctap1.device.recv(CTAPHID.MSG)