From ce8f150a97434f1183f711fdb987a23d301d4dae Mon Sep 17 00:00:00 2001 From: ptweezy Date: Tue, 27 Oct 2026 16:12:26 -0400 Subject: [PATCH] Check the raw streams in test_reader_not_writable and test_writer_not_readable io.BufferedReader.writable() and io.BufferedWriter.readable() return False without asking the raw stream, so the tests could not fail. --- tests/test_igzip_threaded.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_igzip_threaded.py b/tests/test_igzip_threaded.py index dd26e95e..806783ad 100644 --- a/tests/test_igzip_threaded.py +++ b/tests/test_igzip_threaded.py @@ -229,14 +229,16 @@ def test_close_writer(threads): f.close() +# io.BufferedReader.writable() and io.BufferedWriter.readable() are always +# False, so check the raw streams. def test_reader_not_writable(): with igzip_threaded.open(TEST_FILE, "rb") as f: - assert not f.writable() + assert not f.raw.writable() def test_writer_not_readable(): with igzip_threaded.open(io.BytesIO(), "wb") as f: - assert not f.readable() + assert not f.raw.readable() def test_writer_wrong_level():