Releases: Colin-b/pytest_httpx
Releases · Colin-b/pytest_httpx
0.27.0 (2023-11-13)
Added
- Explicit support for python
3.12
.
Fixed
- Custom HTTP transport are now handled (parent call to
handle_async_request
orhandle_request
).
Changed
- Only HTTP transport are now mocked, this should not have any impact, however if it does, please feel free to open an issue describing your use case.
0.26.0 (2023-09-18)
Added
- Added
proxy_url
parameter which allows matching on proxy URL.
0.25.0 (2023-09-11)
0.24.0 (2023-09-04)
Added
- Added
match_json
parameter which allows matching on JSON decoded body (matching against python representation instead of bytes).
Changed
- Even if it was never documented as a feature, the
match_headers
parameter was not considering header names case when matching.- As this might have been considered a feature by some users, the fact that
match_headers
will now respect casing is documented as a breaking change.
- As this might have been considered a feature by some users, the fact that
Fixed
- Matching on headers does not ignore name case anymore, the name must now be cased as sent (as some servers might expect a specific case).
- Error message in case a request does not match will now include request headers with mismatching name case as well.
- Error message in case a request does not match will now include request headers when not provided as lower-cased to
match_headers
. - Add
:Any
type hint to**matchers
function arguments to satisfy strict type checking mode inpyright
.
0.23.1 (2023-08-02)
Fixed
- Version
0.23.0
introduced a regression removing the support for mutating json content provided inhttpx_mock.add_response
.- This is fixed, you can now expect the JSON return being as it was when provided to
httpx_mock.add_response
:
- This is fixed, you can now expect the JSON return being as it was when provided to
mutating_json = {"content": "request 1"}
# This will return {"content": "request 1"}
httpx_mock.add_response(json=mutating_json)
mutating_json["content"] = "request 2"
# This will return {"content": "request 2"}
httpx_mock.add_response(json=mutating_json)
0.23.0 (2023-08-02)
Removed
- Python
3.7
and3.8
are no longer supported.
Fixed
httpx_mock.add_response
is now returning a newhttpx.Response
instance upon each matching request. Preventing unnecessary recursion in streams.
0.22.0 (2023-04-12)
Changed
- Requires
httpx
==0.24.*
0.21.3 (2023-01-20)
Fixed
- Update version specifiers for
pytest
dependency to supportpackaging
23
. - Add explicit support for
python
3.11
.
0.21.2 (2022-11-03)
Fixed
- URL containing non ASCII characters in query can now be matched.
- Requests are now cleared when calling
httpx_mock.reset
.
0.21.1 (2022-10-20)
Fixed
httpx_mock.add_callback
now handles async callbacks.