Skip to content

Releases: Colin-b/pytest_httpx

0.27.0 (2023-11-13)

13 Nov 19:29
55914bc
Compare
Choose a tag to compare

Added

  • Explicit support for python 3.12.

Fixed

  • Custom HTTP transport are now handled (parent call to handle_async_request or handle_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)

18 Sep 17:25
ad53e5f
Compare
Choose a tag to compare

Added

  • Added proxy_url parameter which allows matching on proxy URL.

0.25.0 (2023-09-11)

11 Sep 18:04
02f7f66
Compare
Choose a tag to compare

Changed

Removed

  • pytest 6 is no longer supported.

0.24.0 (2023-09-04)

04 Sep 18:46
fa7920d
Compare
Choose a tag to compare

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.

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 in pyright.

0.23.1 (2023-08-02)

02 Aug 08:26
71b078e
Compare
Choose a tag to compare

Fixed

  • Version 0.23.0 introduced a regression removing the support for mutating json content provided in httpx_mock.add_response.
    • This is fixed, you can now expect the JSON return being as it was when provided to httpx_mock.add_response:
    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)

01 Aug 22:16
cb7dda5
Compare
Choose a tag to compare

Removed

  • Python 3.7 and 3.8 are no longer supported.

Fixed

  • httpx_mock.add_response is now returning a new httpx.Response instance upon each matching request. Preventing unnecessary recursion in streams.

0.22.0 (2023-04-12)

12 Apr 17:05
7127844
Compare
Choose a tag to compare

Changed

0.21.3 (2023-01-20)

20 Jan 09:07
a56f03a
Compare
Choose a tag to compare

Fixed

  • Update version specifiers for pytest dependency to support packaging 23.
  • Add explicit support for python 3.11.

0.21.2 (2022-11-03)

03 Nov 21:05
dc9bb48
Compare
Choose a tag to compare

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)

20 Oct 21:35
123f8cc
Compare
Choose a tag to compare

Fixed

  • httpx_mock.add_callback now handles async callbacks.