MCPcopy Index your code
hub / github.com/encode/httpx / test_client_closed_state_using_implicit_open

Function test_client_closed_state_using_implicit_open

tests/client/test_client.py:305–323  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

303
304
305def test_client_closed_state_using_implicit_open():
306 client = httpx.Client(transport=httpx.MockTransport(hello_world))
307
308 assert not client.is_closed
309 client.get("http://example.com")
310
311 assert not client.is_closed
312 client.close()
313
314 assert client.is_closed
315
316 # Once we're close we cannot make any more requests.
317 with pytest.raises(RuntimeError):
318 client.get("http://example.com")
319
320 # Once we're closed we cannot reopen the client.
321 with pytest.raises(RuntimeError):
322 with client:
323 pass # pragma: no cover
324
325
326def test_client_closed_state_using_with_block():

Callers

nothing calls this directly

Calls 2

getMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected