Skip to content

Commit 9487e56

Browse files
committed
Test threaded also raises errors
1 parent b692d95 commit 9487e56

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/tests_igzip_threaded.py renamed to tests/test_igzip_threaded.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
# PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2.
77

88
import gzip
9+
import io
910
from pathlib import Path
1011

12+
import pytest
13+
1114
from isal import igzip_threaded
1215

1316
TEST_FILE = str((Path(__file__).parent / "data" / "test.fastq.gz"))
@@ -19,3 +22,12 @@ def test_threaded_read():
1922
with gzip.open(TEST_FILE, "rb") as f:
2023
data = f.read()
2124
assert thread_data == data
25+
26+
27+
def test_threaded_error():
28+
with open(TEST_FILE, "rb") as f:
29+
data = f.read()
30+
truncated_data = data[:-8]
31+
with igzip_threaded.open(io.BytesIO(truncated_data), "rb") as tr_f:
32+
with pytest.raises(EOFError):
33+
tr_f.read()

0 commit comments

Comments
 (0)