{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/5"}],"enrichment":{"capability":"A pytest plugin that mocks httpx2 HTTP requests using respx, letting you define expected requests and responses in tests without hitting real endpoints.","skillfed_tags":["http-mocking","test-fixtures"],"use_cases":["Unit test an API client that uses httpx2 without making real network calls or hitting external services.","Test error handling by mocking specific HTTP status codes and response bodies from an API.","Verify that your code constructs the correct request (method, URL, headers, body) before sending it.","Run tests in CI/CD environments where network access is restricted or unreliable."],"what_it_does":"pytest-httpx2 is a pytest plugin that intercepts httpx2 HTTP calls during tests and replaces them with mocked responses defined via respx. Instead of your tests making real network requests, you register expected request patterns and specify what response each should return; the plugin then routes matching calls to those mocks. It integrates directly into pytest's fixture system, injecting a respx.Router as the httpx2_mock fixture that you use to set up your mock responses.\n\nThe plugin supports both inline fixture configuration (passing the router directly to your test function) and pytest marker-based configuration via @pytest.mark.httpx2, which lets you set a base URL and other options declaratively. It has a single runtime dependency on respx and requires Python 3.10 or later.","worth_installing":"Yes, if you use httpx2 in your project and need to test code that makes HTTP calls. The plugin is lightweight, actively maintained, has no known vulnerabilities, and integrates cleanly into pytest's fixture model. Install it alongside your test dependencies."},"id":"pytest-httpx2","links":{"html":"https://skillfed.io/packages/pytest-httpx2","md":"https://skillfed.io/packages/pytest-httpx2.md","pypi":"https://pypi.org/project/pytest-httpx2/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-05-20","license_spdx":"BSD-3-Clause","license_treatment":"permissive","name":"pytest-httpx2","python_support":"supports_current","summary":"A pytest plugin for mocking out httpx2 using respx."},"popularity":{"monthly_downloads":140866,"position":11261,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.0.0"}
