]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Trivial-case test for response.elapsed
authorTom Christie <tom@tomchristie.com>
Mon, 9 Dec 2019 17:12:20 +0000 (17:12 +0000)
committerTom Christie <tom@tomchristie.com>
Mon, 9 Dec 2019 17:12:20 +0000 (17:12 +0000)
tests/client/test_client.py

index 2cbd4e7787275da3e695a9d35ccc454e562286b2..851896146ed07bb73b9e175a305b0edda6c64eff 100644 (file)
@@ -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