Skip to content

Commit 4655b0c

Browse files
committed
Add tests for proper closing
1 parent cee076d commit 4655b0c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_igzip_threaded.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,16 @@ def test_threaded_write_error(monkeypatch):
8181
with igzip_threaded.open(tmp, "wb", compresslevel=3) as writer:
8282
writer.write(b"x")
8383
error.match("no attribute 'compressobj'")
84+
85+
86+
def test_close_reader():
87+
f = igzip_threaded.open(TEST_FILE, "rb")
88+
f.close()
89+
assert f.closed
90+
91+
92+
def test_close_writer():
93+
raw = tempfile.TemporaryFile()
94+
f = igzip_threaded.open(raw, "wb")
95+
f.close()
96+
assert f.closed

0 commit comments

Comments
 (0)