Skip to content

Commit c84f90d

Browse files
committed
Reproduce resourcewarning
1 parent 5871c6f commit c84f90d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_igzip_threaded.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,11 @@ def test_writer_not_readable():
139139

140140

141141
def test_writer_wrong_level():
142-
with pytest.raises(ValueError) as error:
143-
igzip_threaded._ThreadedGzipWriter(io.BytesIO(), level=42)
144-
error.match("Invalid compression level")
145-
error.match("42")
142+
with tempfile.NamedTemporaryFile("wb") as tmp:
143+
with pytest.raises(ValueError) as error:
144+
igzip_threaded.open(tmp.name, mode="wb", compresslevel=42)
145+
error.match("Invalid compression level")
146+
error.match("42")
146147

147148

148149
def test_writer_too_low_threads():

0 commit comments

Comments
 (0)