httpx.Response.elapsed cannot be accessed anymore
Closed this issue · 5 comments
mvbrn commented
I have logging that reads request time from .elapsed
attribute of httpx.Request
. Everything works with 0.13, but after upgrading to 0.15 I'm getting exceptions:
'.elapsed' may only be accessed after the response has been read or closed.
My versions:
httpx==0.21.1
pytest-httpx==0.15.0
Colin-b commented
Hello @mvbrn , would you mind sharing your code?
This issue seems to be related to httpx (from what you are saying, you bumped httpx from 0.19 to 0.21), are you sure your code works without the mock? ie: does it work in real condition?
Thanks again
Colin-b commented
I confirm that I am able to reproduce your issue.