From: Tom Christie Date: Wed, 1 May 2019 08:46:19 +0000 (+0100) Subject: Merge branch 'master' into wait-for-connection-close X-Git-Tag: 0.3.0~53^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20bc1f353005a71fa74d238ad00e1ab8bcaf86be;p=thirdparty%2Fhttpx.git Merge branch 'master' into wait-for-connection-close --- 20bc1f353005a71fa74d238ad00e1ab8bcaf86be diff --cc tests/test_sync.py index 28dbc328,bb3e1cbd..43561a3d --- a/tests/test_sync.py +++ b/tests/test_sync.py @@@ -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!"