Skip to content

Commit e8dee1c

Browse files
committed
Add a test for long window size zstandard compression
1 parent bc9e899 commit e8dee1c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/only_zeroes.zst

64.2 KB
Binary file not shown.

tests/test_xopen.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,18 @@ def test_xopen_zst_fails_when_zstandard_not_available(monkeypatch):
576576
f.read()
577577

578578

579+
@pytest.mark.parametrize("threads", (None, 0, 1))
580+
def test_xopen_zst_long_window_size(threads):
581+
if threads == 0 and zstandard is None:
582+
return
583+
elif threads == 1 and not shutil.which("zstd"):
584+
return
585+
test_zst = Path(__file__).parent / "only_zeroes.zst"
586+
with xopen(test_zst, "rb", threads=threads) as f:
587+
data = f.read()
588+
assert len(data) == 2**31
589+
590+
579591
@pytest.mark.parametrize("threads", (0, 1))
580592
@pytest.mark.parametrize("ext", extensions)
581593
def test_pass_file_object_for_reading(ext, threads):

0 commit comments

Comments
 (0)