Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tests/test_igzip_threaded.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ def test_threaded_read():
assert thread_data == data


@pytest.mark.parametrize("block_size", [8 * 1024, 64 * 1024])
@pytest.mark.parametrize(["mode", "threads"],
list(itertools.product(["wb", "wt"], [1, 3, -1])))
def test_threaded_write(tmp_path, mode, threads):
def test_threaded_write(tmp_path, mode, threads, block_size):
with open(tmp_path / "output.gz", "wb") as tmp:
# Use a small block size to simulate many writes.
# Use small block sizes to simulate many writes. Each block uses up
# to 32 KiB from the end of the previous block as a dictionary, so
# also test a block size above 32 KiB.
with igzip_threaded.open(tmp, mode, threads=threads,
block_size=8*1024) as out_file:
block_size=block_size) as out_file:
gzip_open_mode = "rb" if "b" in mode else "rt"
with gzip.open(TEST_FILE, gzip_open_mode) as in_file:
while True:
Expand Down
Loading