(self)
| 1216 | assert n3 == 0 |
| 1217 | |
| 1218 | def test_io_not_autoclose_bufferedreader(self) -> None: |
| 1219 | fp = BytesIO(b"hello\nworld") |
| 1220 | resp = HTTPResponse(fp, preload_content=False, auto_close=False) |
| 1221 | reader = BufferedReader(resp) |
| 1222 | assert list(reader) == [b"hello\n", b"world"] |
| 1223 | |
| 1224 | assert not reader.closed |
| 1225 | assert not resp.closed |
| 1226 | with pytest.raises(StopIteration): |
| 1227 | next(reader) |
| 1228 | |
| 1229 | reader.close() |
| 1230 | assert reader.closed |
| 1231 | assert resp.closed |
| 1232 | with pytest.raises(ValueError, match="readline of closed file"): |
| 1233 | next(reader) |
| 1234 | |
| 1235 | def test_io_textiowrapper(self) -> None: |
| 1236 | fp = BytesIO(b"\xc3\xa4\xc3\xb6\xc3\xbc\xc3\x9f") |
nothing calls this directly
no test coverage detected