test_timeouts.py
This file
Path
tests/test_timeouts.py
39 lines · 1.3 KiB · Python
Last changed by
Refactor tests in the light of backend auto-detection (#615)Florimond Mancabefore adoptionab41a5d
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 back8Refactor tests in the light of backend auto-detection (#615)Florimond Mancabefore adoptionab41a5d
line 9why, one step back9 async with httpx.Client(timeout=timeout) as client:Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 10why, one step back10 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 back16Refactor tests in the light of backend auto-detection (#615)Florimond Mancabefore adoptionab41a5d
line 17why, one step back17 async with httpx.Client(timeout=timeout) as client:Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 18why, one step back18 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 back25Refactor tests in the light of backend auto-detection (#615)Florimond Mancabefore adoptionab41a5d
line 26why, one step back26 async with httpx.Client(timeout=timeout) as client:Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 27why, one step back27 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 back35Refactor tests in the light of backend auto-detection (#615)Florimond Mancabefore adoptionab41a5d
line 36why, one step back36 async with httpx.Client(pool_limits=pool_limits, timeout=timeout) as client:Add Client.stream() method. (#600)Tom Christiebefore adoption8d8ea8b
line 37why, one step back37 async with client.stream("GET", server.url):Tighten up top-level API to only expose public API (#608)Tom Christiebefore adoptiond15dc0b
line 38why, one step back38 with pytest.raises(httpx.PoolTimeout):Add Client.stream() method. (#600)Tom Christiebefore adoption8d8ea8b
line 39why, one step back39 await client.get("http://localhost:8000/")