Skip to content

Commit 0fef0a9

Browse files
committed
Fix test for older versions of python
1 parent 85e9d48 commit 0fef0a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_igzip_threaded.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ def test_threaded_program_can_exit_on_error(tmp_path, mode, threads):
245245
@pytest.mark.parametrize("threads", [1, 2])
246246
def test_flush(tmp_path, threads):
247247
empty_block_end = b"\x00\x00\xff\xff"
248-
deflate_last_block = zlib.compress(b"", wbits=-15)
248+
compressobj = zlib.compressobj(wbits=-15)
249+
deflate_last_block = compressobj.compress(b"") + compressobj.flush()
249250
test_file = tmp_path / "output.gz"
250251
with igzip_threaded.open(test_file, "wb", threads=threads) as f:
251252
f.write(b"1")

0 commit comments

Comments
 (0)