TypeError in httpx/_models.py:328 after bump to 0.23.1 #2451
Answered
by
lovelydinosaur
ThomasDsantos
asked this question in
Potential Issue
-
|
Hello all ! 😄 Today i upgraded a new project from 0.23.0 to 0.23.1, when running my tests it detected an error : It was done through venv, pytest 7.2.0 and python 3.11.0 here is a basic reproduction example : this work with httpx 0.23.0 but not on 0.23.1 import pytest
import httpx
@pytest.fixture(autouse=True)
def mock_api(respx_mock):
yield respx_mock.get("/token").mock(
return_value=httpx.Response(200, json={})
)
def test():
HTTPX_CLIENT = httpx.Client(timeout=httpx.Timeout(3, connect=5))
url = "https://example.com/token"
params = {}
method = "get"
with HTTPX_CLIENT as client:
request = httpx.Request(
method.upper(), url, params=params
)
print(client.send(request))
test() |
Beta Was this translation helpful? Give feedback.
Answered by
lovelydinosaur
Nov 21, 2022
Replies: 1 comment
-
|
Okay. This is on me really. We shouldn't have dropped the The |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lovelydinosaur
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Okay. This is on me really. We shouldn't have dropped the
httpx.RawURL()API in a minor release.(Even if it was a grungy undocumented bit of left over stuff).
The
respxpackage was using this, and broke as a result. Resolved via lundberg/respx#223.