response = await client.get(url)
assert response.status_code == 200
assert response.extensions["http_version"] == b"HTTP/1.1"
+
+
+def test_http2_parameter_deprecated():
+ # The 'http1' and 'http2' flags are deprecated in favor of `version=httpx.Version(...)`.
+ with pytest.raises(RuntimeError):
+ httpx.AsyncClient(http2=True)
assert response.reason_phrase == "OK"
assert response.encoding == "ISO-8859-1"
assert response.text == text
+
+
+def test_http2_parameter_deprecated():
+ # The 'http1' and 'http2' flags are deprecated in favor of `version=httpx.Version(...)`.
+ with pytest.raises(RuntimeError):
+ httpx.Client(http2=True)