(self, sock: socket.socket)
| 1051 | resp3.fileno() |
| 1052 | |
| 1053 | def test_io_closed_consistently_by_read(self, sock: socket.socket) -> None: |
| 1054 | try: |
| 1055 | hlr = httplib.HTTPResponse(sock) |
| 1056 | hlr.fp = BytesIO(b"foo") # type: ignore[assignment] |
| 1057 | hlr.chunked = 0 # type: ignore[assignment] |
| 1058 | hlr.length = 3 |
| 1059 | with HTTPResponse(hlr, preload_content=False) as resp: |
| 1060 | assert not resp.closed |
| 1061 | assert resp._fp is not None |
| 1062 | assert not resp._fp.isclosed() |
| 1063 | assert not is_fp_closed(resp._fp) |
| 1064 | assert not resp.isclosed() |
| 1065 | resp.read() |
| 1066 | assert resp.closed |
| 1067 | assert resp._fp.isclosed() |
| 1068 | assert is_fp_closed(resp._fp) |
| 1069 | assert resp.isclosed() |
| 1070 | finally: |
| 1071 | hlr.close() |
| 1072 | |
| 1073 | @pytest.mark.parametrize("read_amt", (None, 3)) |
| 1074 | @pytest.mark.parametrize("length_known", (True, False)) |
nothing calls this directly
no test coverage detected