Skip to content

0.33.0 (2024-10-28)

Compare
Choose a tag to compare
@Colin-b Colin-b released this 28 Oct 20:34
· 17 commits to master since this release
f0e070d

Added

  • Explicit support for python 3.13.
  • should_mock option (callable returning a boolean) is now available, defaulting to always returning True. Refer to documentation for more details.
  • Matching on the full multipart body can now be performed using match_files and match_data parameters. Refer to documentation for more details.
  • Matching on extensions (including timeout) can now be performed using match_extensions parameter. Refer to documentation for more details.

Removed

  • non_mocked_hosts option is not available anymore. Use should_mock instead as in the following sample:
    import pytest
    
    @pytest.mark.httpx_mock(non_mocked_hosts=["my_local_test_host"])
    def test_previous_behavior(httpx_mock):
        ...
    
    @pytest.mark.httpx_mock(should_mock=lambda request: request.url.host not in ["my_local_test_host"])
    def test_new_behavior(httpx_mock):
        ...
    Please note that your hosts might need to be prefixed with www. depending on your usage.