From a2a183942dc796e5d8e59062e50e41288b16e371 Mon Sep 17 00:00:00 2001 From: Dave Johansen Date: Mon, 16 Oct 2023 14:50:30 -0600 Subject: [PATCH] Catch the expected type of error --- tests/test_loader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_loader.py b/tests/test_loader.py index 57ec40ee..a3a33fbd 100644 --- a/tests/test_loader.py +++ b/tests/test_loader.py @@ -4,6 +4,7 @@ # license that can be found in the LICENSE file. import os +import socket import urllib.parse import m3u8 import pytest @@ -142,7 +143,7 @@ def test_presence_of_base_uri_if_provided_when_loading_from_string(): def test_raise_timeout_exception_if_timeout_happens_when_loading_from_uri(): try: m3u8.load(playlists.TIMEOUT_SIMPLE_PLAYLIST_URI, timeout=1) - except: + except socket.timeout: assert True else: assert False