Skip to content

Commit 3148afd

Browse files
committed
Improve zstandard window size test
1 parent b02491f commit 3148afd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/test_xopen.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,16 +576,20 @@ def test_xopen_zst_fails_when_zstandard_not_available(monkeypatch):
576576
f.read()
577577

578578

579-
@pytest.mark.parametrize("threads", (None, 0, 1))
579+
@pytest.mark.parametrize("threads", (0, 1))
580580
def test_xopen_zst_long_window_size(threads):
581581
if threads == 0 and zstandard is None:
582582
return
583583
elif threads == 1 and not shutil.which("zstd"):
584584
return
585+
# File created with:
586+
# cat /dev/zero | head -c 2147483648 > only_zeroes
587+
# Then compressed with
588+
# zstd --long=31 -19 only_zeroes
585589
test_zst = Path(__file__).parent / "only_zeroes.zst"
586590
with xopen(test_zst, "rb", threads=threads) as f:
587-
data = f.read()
588-
assert len(data) == 2**31
591+
data = f.read(1024)
592+
assert data == bytes(1024)
589593

590594

591595
@pytest.mark.parametrize("threads", (0, 1))

0 commit comments

Comments
 (0)