]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Attempt to resolve test flakiness (#946)
authorTom Christie <tom@tomchristie.com>
Tue, 12 May 2020 15:02:25 +0000 (16:02 +0100)
committerGitHub <noreply@github.com>
Tue, 12 May 2020 15:02:25 +0000 (16:02 +0100)
tests/client/test_client.py
tests/conftest.py

index 71687e64b61277c80bb63937d00ca4ccf07beaff..1555690bbda2e18f43086dd803875bd741daa3ba 100644 (file)
@@ -146,10 +146,3 @@ def test_merge_url():
 
     assert url.scheme == "https"
     assert url.is_ssl
-
-
-def test_elapsed_delay(server):
-    url = server.url.copy_with(path="/slow_response/100")
-    with httpx.Client() as client:
-        response = client.get(url)
-    assert response.elapsed.total_seconds() > 0.0
index 15ae78bbfcb1c3a5bcb549ff4997994f07305aca..d5be55f4b29e4b6066eadd9bb42d568e4a7f1f67 100644 (file)
@@ -102,12 +102,7 @@ async def hello_world(scope, receive, send):
 
 
 async def slow_response(scope, receive, send):
-    delay_ms_str: str = scope["path"].replace("/slow_response/", "")
-    try:
-        delay_ms = float(delay_ms_str)
-    except ValueError:
-        delay_ms = 100
-    await sleep(delay_ms / 1000.0)
+    await sleep(1.0)
     await send(
         {
             "type": "http.response.start",