]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Merge branch 'master' into wait-for-connection-close
authorTom Christie <tom@tomchristie.com>
Wed, 1 May 2019 08:46:19 +0000 (09:46 +0100)
committerGitHub <noreply@github.com>
Wed, 1 May 2019 08:46:19 +0000 (09:46 +0100)
1  2 
httpcore/sync.py
tests/test_sync.py

Simple merge
index 28dbc328306118259be5c9248ba3851efc1f19bd,bb3e1cbd5128bd1085732b05862b7c2792e8335a..43561a3d95927dd72eb99276357e58f903cf3a94
@@@ -53,18 -52,7 +52,18 @@@ def test_stream_iterator(server)
      with httpcore.SyncConnectionPool() as http:
          response = http.request("GET", "http://127.0.0.1:8000/", stream=True)
      assert response.status_code == 200
-     body = b""
+     content = b""
      for chunk in response.stream():
 -        content += chunk
 -    assert content == b"Hello, world!"
 +        body += chunk
 +    assert body == b"Hello, world!"
 +
 +
 +@threadpool
 +def test_raw_iterator(server):
 +    with httpcore.SyncConnectionPool() as http:
 +        response = http.request("GET", "http://127.0.0.1:8000/", stream=True)
 +    assert response.status_code == 200
 +    body = b""
 +    for chunk in response.raw():
 +        body += chunk
 +    assert body == b"Hello, world!"