Commit ec3cc2c 1 parent aa813d1 commit ec3cc2c Copy full SHA for ec3cc2c
File tree 2 files changed +3
-14
lines changed
2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -64,12 +64,9 @@ def opener(path):
64
64
return gzip .open (path , mode = 'rt' )
65
65
else :
66
66
opener = open
67
- try :
68
- with opener (self .path ) as tsvfile :
69
- for line in tsvfile :
70
- yield from self ._parse_tsv_line (line )
71
- except FileNotFoundError as err :
72
- raise AnnifException (str (err ))
67
+ with opener (self .path ) as tsvfile :
68
+ for line in tsvfile :
69
+ yield from self ._parse_tsv_line (line )
73
70
74
71
def _parse_tsv_line (self , line ):
75
72
if '\t ' in line :
Original file line number Diff line number Diff line change @@ -220,14 +220,6 @@ def test_docfile_plain(tmpdir):
220
220
assert len (list (docs .documents )) == 3
221
221
222
222
223
- def test_docfile_nonexistent (tmpdir ):
224
- docfile = tmpdir .join ('documents_nonexistent.tsv' )
225
- with pytest .raises (AnnifException ) as err :
226
- docs = annif .corpus .DocumentFile (str (docfile ))
227
- list (docs .documents )
228
- assert "No such file or directory: '{}'" .format (docfile ) in str (err .value )
229
-
230
-
231
223
def test_docfile_plain_invalid_lines (tmpdir , caplog ):
232
224
logger = annif .logger
233
225
logger .propagate = True
You can’t perform that action at this time.
0 commit comments