test_timeouts.py
This file
Path
tests/test_timeouts.py
52 lines · 1.5 KiB · Python
Last changed by
TimeoutConfig -> Timeout (#591)Tom Christiebefore adoptionc033ed1
History of this fileTake it
The walk stopped after 200 commits: lines older than 7e9110b point at it.
Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
lines 1–3why, one step back1import pytest23from httpx import (Fix bug when using client without timeouts in Python 3.6 (#383)Florimond Mancabefore adoptioncadb9a4
line 4why, one step back4 Client,Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
lines 5–8why, one step back5 ConnectTimeout,6 PoolLimits,7 PoolTimeout,8 ReadTimeout,TimeoutConfig -> Timeout (#591)Tom Christiebefore adoptionc033ed1
line 9why, one step back9 Timeout,Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
lines 10–13why, one step back10 WriteTimeout,11)1213Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058
line 14why, one step back14async def test_read_timeout(server, backend):TimeoutConfig -> Timeout (#591)Tom Christiebefore adoptionc033ed1
line 15why, one step back15 timeout = Timeout(read_timeout=1e-6)Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
line 16why, one step back16Drop sync (#544)Tom Christiebefore adoption206c537
line 17why, one step back17 async with Client(timeout=timeout, backend=backend) as client:Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
line 18why, one step back18 with pytest.raises(ReadTimeout):Add server.url property in tests (#300)Bakhtiyor Ruzievbefore adoptione34d280
line 19why, one step back19 await client.get(server.url.copy_with(path="/slow_response"))Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
lines 20–21why, one step back2021Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058
line 22why, one step back22async def test_write_timeout(server, backend):TimeoutConfig -> Timeout (#591)Tom Christiebefore adoptionc033ed1
line 23why, one step back23 timeout = Timeout(write_timeout=1e-6)Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
line 24why, one step back24Drop sync (#544)Tom Christiebefore adoption206c537
line 25why, one step back25 async with Client(timeout=timeout, backend=backend) as client:Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
lines 26–27why, one step back26 with pytest.raises(WriteTimeout):27 data = b"*" * 1024 * 1024 * 100Add server.url property in tests (#300)Bakhtiyor Ruzievbefore adoptione34d280
line 28why, one step back28 await client.put(server.url.copy_with(path="/slow_response"), data=data)Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
lines 29–30why, one step back2930Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058
line 31why, one step back31async def test_connect_timeout(server, backend):TimeoutConfig -> Timeout (#591)Tom Christiebefore adoptionc033ed1
line 32why, one step back32 timeout = Timeout(connect_timeout=1e-6)Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
line 33why, one step back33Drop sync (#544)Tom Christiebefore adoption206c537
line 34why, one step back34 async with Client(timeout=timeout, backend=backend) as client:Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
lines 35–39why, one step back35 with pytest.raises(ConnectTimeout):36 # See https://stackoverflow.com/questions/100841/37 await client.get("http://10.255.255.1/")3839Parametrize tests with concurrency backend (#273)Florimond Mancabefore adoption3674058
line 40why, one step back40async def test_pool_timeout(server, backend):Pool timeouts should be on the TimeoutConfig, not PoolLimits (#563)Tom Christiebefore adoption364378a
line 41why, one step back41 pool_limits = PoolLimits(hard_limit=1)TimeoutConfig -> Timeout (#591)Tom Christiebefore adoptionc033ed1
line 42why, one step back42 timeout = Timeout(pool_timeout=1e-4)Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
line 43why, one step back43Pool timeouts should be on the TimeoutConfig, not PoolLimits (#563)Tom Christiebefore adoption364378a
lines 44–46why, one step back44 async with Client(45 pool_limits=pool_limits, timeout=timeout, backend=backend46 ) as client:Add server.url property in tests (#300)Bakhtiyor Ruzievbefore adoptione34d280
line 47why, one step back47 response = await client.get(server.url, stream=True)Add additional flake8 plugins (#157)Can Sarıgölbefore adoption7e9110b
lines 48–52why, one step back4849 with pytest.raises(PoolTimeout):50 await client.get("http://localhost:8000/")5152 await response.read()