We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d5aadb commit b5b74b0Copy full SHA for b5b74b0
tests/conftest.py
@@ -11,6 +11,7 @@
11
cast,
12
)
13
from unittest.mock import AsyncMock, MagicMock
14
+import urllib.parse
15
16
import httpx
17
import pytest
@@ -162,6 +163,14 @@ def inner(
162
163
def capture_and_mock(*args, **kwargs):
164
request_kwargs.update(kwargs)
165
166
+ # Capture full URL with encoded params while keeping original URL
167
+ if "params" in kwargs:
168
+ # Convert params to query string with proper URL encoding
169
+ query_string = urllib.parse.urlencode(
170
+ kwargs["params"], doseq=True, quote_via=urllib.parse.quote_plus
171
+ )
172
+ request_kwargs["full_url"] = f"{kwargs['url']}?{query_string}"
173
+
174
return httpx.Response(
175
status_code=status_code,
176
headers=headers,
0 commit comments