From: Tom Christie Date: Mon, 9 Dec 2019 17:12:20 +0000 (+0000) Subject: Trivial-case test for response.elapsed X-Git-Tag: 0.9.4~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02d16bfb34e2af183b1b014b3109e1e322611758;p=thirdparty%2Fhttpx.git Trivial-case test for response.elapsed --- diff --git a/tests/client/test_client.py b/tests/client/test_client.py index 2cbd4e77..85189614 100644 --- a/tests/client/test_client.py +++ b/tests/client/test_client.py @@ -1,5 +1,4 @@ from datetime import timedelta -from time import sleep import pytest @@ -180,15 +179,4 @@ async def test_elapsed_delay(server): url = server.url.copy_with(path="/slow_response/100") async with httpx.Client() as client: response = await client.get(url) - assert response.elapsed.total_seconds() == pytest.approx(0.1, rel=0.2) - - -@pytest.mark.asyncio -async def test_elapsed_delay_ignores_read_time(server): - url = server.url.copy_with(path="/slow_response/100") - async with httpx.Client() as client: - async with client.stream("GET", url) as response: - sleep(0.2) - await response.read() - - assert response.elapsed.total_seconds() == pytest.approx(0.1, rel=0.2) + assert response.elapsed.total_seconds() > 0.0