8000 TEST: fixed broken test · larray-project/larray_eurostat@7402c3c · GitHub
[go: up one dir, main page]

Skip to content

Commit 7402c3c

Browse files
committed
TEST: fixed broken test
(no longer produced the same error)
1 parent 4a71b9c commit 7402c3c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

larray_eurostat/tests/test_tsv.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import re
2+
from urllib.error import HTTPError
23

34
import pytest
45

5-
from larray_eurostat.tsv import eurostat_get, EUROSTAT_BASEURL
6+
from larray_eurostat.tsv import eurostat_get
67

78

89
def test_eurostat_get_bad_dataset():
9-
dataset = 'nama_aux_cra'
10+
dataset = 'does-not-exist'
1011

11-
msg = f"Not a gzipped file (b'<!')\nCan't open file {EUROSTAT_BASEURL}data/{dataset}.tsv.gz"
12-
with pytest.raises(OSError, match=f'^{re.escape(msg)}$'):
12+
msg = "HTTP Error 404: Not Found"
13+
with pytest.raises(HTTPError, match=f'^{re.escape(msg)}$'):
1314
eurostat_get(dataset)

0 commit comments

Comments
 (0)
0