test_timeouts.py
This file
Path
tests/test_timeouts.py
41 lines · 1.4 KiB · Python
Last changed by
Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
History of this fileTake it
The walk stopped after 200 commits: lines older than a960a2a point at it.
Release semaphore if connection is dropped (#230)Ordanis Sanchezbefore adoptiona960a2a
lines 1–2why, one step back1import pytest2Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 3why, one step back3import httpxRelease semaphore if connection is dropped (#230)Ordanis Sanchezbefore adoptiona960a2a
lines 4–5why, one step back45Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058
line 6why, one step back6async def test_read_timeout(server, backend):Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 7why, one step back7 timeout = httpx.Timeout(read_timeout=1e-6)Release semaphore if connection is dropped (#230)Ordanis Sanchezbefore adoptiona960a2a
line 8why, one step back8Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
lines 9–10why, one step back9 async with httpx.Client(timeout=timeout, backend=backend) as client:10 with pytest.raises(httpx.ReadTimeout):Add server.url property in tests (#300)Bakhtiyor Ruzievbefore adoptione34d280
line 11why, one step back11 await client.get(server.url.copy_with(path="/slow_response"))Release semaphore if connection is dropped (#230)Ordanis Sanchezbefore adoptiona960a2a
lines 12–13why, one step back1213Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058
line 14why, one step back14async def test_write_timeout(server, backend):Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 15why, one step back15 timeout = httpx.Timeout(write_timeout=1e-6)Release semaphore if connection is dropped (#230)Ordanis Sanchezbefore adoptiona960a2a
line 16why, one step back16Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
lines 17–18why, one step back17 async with httpx.Client(timeout=timeout, backend=backend) as client:18 with pytest.raises(httpx.WriteTimeout):Release semaphore if connection is dropped (#230)Ordanis Sanchezbefore adoptiona960a2a
line 19why, one step back19 data = b"*" * 1024 * 1024 * 100Add server.url property in tests (#300)Bakhtiyor Ruzievbefore adoptione34d280
line 20why, one step back20 await client.put(server.url.copy_with(path="/slow_response"), data=data)Release semaphore if connection is dropped (#230)Ordanis Sanchezbefore adoptiona960a2a
lines 21–22why, one step back2122Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058
line 23why, one step back23async def test_connect_timeout(server, backend):Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 24why, one step back24 timeout = httpx.Timeout(connect_timeout=1e-6)Release semaphore if connection is dropped (#230)Ordanis Sanchezbefore adoptiona960a2a
line 25why, one step back25Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
lines 26–27why, one step back26 async with httpx.Client(timeout=timeout, backend=backend) as client:27 with pytest.raises(httpx.ConnectTimeout):Release semaphore if connection is dropped (#230)Ordanis Sanchezbefore adoptiona960a2a
lines 28–31why, one step back28 # See https://stackoverflow.com/questions/100841/29 await client.get("http://10.255.255.1/")3031Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058
line 32why, one step back32async def test_pool_timeout(server, backend):Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
lines 33–34why, one step back33 pool_limits = httpx.PoolLimits(hard_limit=1)34 timeout = httpx.Timeout(pool_timeout=1e-4)Release semaphore if connection is dropped (#230)Ordanis Sanchezbefore adoptiona960a2a
line 35why, one step back35Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 36why, one step back36 async with httpx.Client(Pool timeouts should be on the TimeoutConfig, not PoolLimits (#563)Tom Christiebefore adoption364378a
lines 37–38why, one step back37 pool_limits=pool_limits, timeout=timeout, backend=backend38 ) as client:Add Client.stream() method. (#600)Tom Christiebefore adoption8d8ea8b
line 39why, one step back39 async with client.stream("GET", server.url):Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 40why, one step back40 with pytest.raises(httpx.PoolTimeout):Add Client.stream() method. (#600)Tom Christiebefore adoption8d8ea8b
line 41why, one step back41 await client.get("http://localhost:8000/")