Skip to content

Commit c92f28c

Browse files
committed
Test append mode also with threads
1 parent de97729 commit c92f28c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_xopen.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,16 @@ def test_invalid_compression_level(tmp_path):
263263

264264

265265
@pytest.mark.parametrize("ext", extensions)
266-
def test_append(ext, tmp_path):
266+
@pytest.mark.parametrize("threads", (0, 1))
267+
def test_append(ext, threads, tmp_path):
268+
if ext == ".zst" and zstandard is None and threads == 0:
269+
pytest.skip("No zstandard installed")
267270
text = b"AB"
268271
reference = text + text
269272
path = tmp_path / f"the-file{ext}"
270-
with xopen(path, "ab") as f:
273+
with xopen(path, "ab", threads=threads) as f:
271274
f.write(text)
272-
with xopen(path, "ab") as f:
275+
with xopen(path, "ab", threads=threads) as f:
273276
f.write(text)
274277
with xopen(path, "r") as f:
275278
for appended in f:

0 commit comments

Comments
 (0)