v0.14.0
版本发布时间: 2021-10-23 01:28:34
Colin-b/pytest_httpx最新发布版本:v0.31.2(2024-09-24 01:21:15)
Changed
- Requires
httpx
==0.20.* (many thanks toTerence Honles
) - Callbacks are now expected to return a
httpx.Response
instance instead of the previoushttpcore.Response
tuple. As a consequence,pytest_httpx.to_response
now returns ahttpx.Response
instance.
Added
-
httpx_mock.add_response
now allows to explicitly provide bytes usingcontent
parameter. -
httpx_mock.add_response
now allows to explicitly provide string usingtext
parameter. -
httpx_mock.add_response
now allows to explicitly provide HTML string content usinghtml
parameter. -
httpx_mock.add_response
now allows to explicitly provide streamed content usingstream
parameter and the newpytest_httpx.IteratorStream
class.
Deprecated
-
pytest_httpx.to_response
is now deprecated in favor ofhttpx.Response
. This function will be removed in a future release. -
httpx_mock.add_response
data
parameter should now only be used for multipart content. Instead, use the appropriate parameter amongstcontent
,text
,html
orstream
.