Skip to content

0.14.0 (2021-10-22)

Choose a tag to compare

@Colin-b Colin-b released this 22 Oct 17:28
· 312 commits to master since this release
a734c6e

Changed

  • Requires httpx==0.20.* (many thanks to Terence Honles)
  • Callbacks are now expected to return a httpx.Response instance instead of the previous httpcore.Response tuple. As a consequence, pytest_httpx.to_response now returns a httpx.Response instance.

Added

  • httpx_mock.add_response now allows to explicitly provide bytes using content parameter.
  • httpx_mock.add_response now allows to explicitly provide string using text parameter.
  • httpx_mock.add_response now allows to explicitly provide HTML string content using html parameter.
  • httpx_mock.add_response now allows to explicitly provide streamed content using stream parameter and the new pytest_httpx.IteratorStream class.

Deprecated

  • pytest_httpx.to_response is now deprecated in favor of httpx.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 amongst content, text, html or stream.