Skip to content

Releases: Colin-b/pytest_httpx

0.30.0 (2024-02-21)

21 Feb 18:01
36c5062
Compare
Choose a tag to compare

Changed

Fixed

  • Switch from setup.py to pyproject.toml (many thanks to Felix Scherz).

0.29.0 (2024-01-29)

29 Jan 20:11
fcb442a
Compare
Choose a tag to compare

Added

0.28.0 (2023-12-21)

21 Dec 09:20
0abf1eb
Compare
Choose a tag to compare

Changed

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