-
-
Notifications
You must be signed in to change notification settings - Fork 990
Open
Description
This is not a nice solution:
def handler(request):
resp = httpx.Response(200, json={"text": "Hello, world!"})
resp.elapsed = timedelta(.......
return resp
If you have dispatch code in that handler that can easily get boilerplatey.
I think httpx should do either of these:
- MockTransport take the duration as an optional argument
- httpx provide a decorator, so you can wrap your handler in it
- automatically set a duration of 0 for manually created Response objects - why error out if the data is already there?
Metadata
Metadata
Assignees
Labels
No labels