Skip to content

Commit

Permalink
Catch the expected type of error
Browse files Browse the repository at this point in the history
  • Loading branch information
daveisfera committed Nov 17, 2023
1 parent f48026d commit f19ef34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# license that can be found in the LICENSE file.

import os
import socket
import urllib.parse
import m3u8
import pytest
Expand Down Expand Up @@ -141,7 +142,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

0 comments on commit f19ef34

Please sign in to comment.