@@ -569,25 +569,25 @@ def test_xopen_zst_fails_when_zstandard_not_available(monkeypatch):
569
569
f .read ()
570
570
571
571
572
- @pytest .mark .parametrize (" ext", extensions )
573
- def test_pass_file_object_for_reading_no_threads (ext ):
572
+ @pytest .mark .parametrize ([ "threads" , " ext"], itertools . product (( 0 , 1 ), extensions ) )
573
+ def test_pass_file_object_for_reading (ext , threads ):
574
574
if ext == ".zst" and zstandard is None :
575
575
return
576
576
577
577
with open (TEST_DIR / f"file.txt{ ext } " , "rb" ) as fh :
578
- with xopen (fh , mode = "rb" , threads = 0 ) as f :
578
+ with xopen (fh , mode = "rb" , threads = threads ) as f :
579
579
assert f .readline () == CONTENT_LINES [0 ].encode ("utf-8" )
580
580
581
581
582
- @pytest .mark .parametrize (" ext", extensions )
583
- def test_pass_file_object_for_writing (tmp_path , ext ):
582
+ @pytest .mark .parametrize ([ "threads" , " ext"], itertools . product (( 0 , 1 ), extensions ) )
583
+ def test_pass_file_object_for_writing (tmp_path , ext , threads ):
584
584
if ext == ".zst" and zstandard is None :
585
585
return
586
586
first_line = CONTENT_LINES [0 ].encode ("utf-8" )
587
587
with open (tmp_path / "out{ext}" , "wb" ) as fh :
588
- with xopen (fh , "wb" ) as f :
588
+ with xopen (fh , "wb" , threads = threads ) as f :
589
589
f .write (first_line )
590
- with xopen (tmp_path / "out{ext}" , "rb" ) as fh :
590
+ with xopen (tmp_path / "out{ext}" , "rb" , threads = threads ) as fh :
591
591
assert fh .readline () == first_line
592
592
593
593
0 commit comments