{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/5"}],"enrichment":{"capability":"A pytest fixture and standalone context manager that runs a fake HTTP server on localhost, letting you test HTTP clients without hitting real servers by defining expected requests and their responses.","skillfed_tags":["http-mocking","test-fixture"],"use_cases":["Test an HTTP client library by mocking server responses without running a real server.","Verify that your code sends the correct HTTP method, headers, and body to an API.","Test ordered sequences of requests in a single test, ensuring your client makes calls in the right order.","Run integration tests in CI/CD pipelines where external HTTP services may be unavailable.","Use the standalone context manager in non-pytest code to set up temporary HTTP server expectations."],"what_it_does":"pytest-httpserver provides a pytest fixture and standalone context manager that starts a local HTTP server to intercept and respond to client requests during tests. Instead of mocking individual HTTP calls, you define expectations\u2014matching on URI, method, headers, query strings, and request body\u2014and specify what response the server should send back. The server can handle permanent expectations (served repeatedly), one-shot expectations (served once), and ordered expectations (served in strict sequence). Responses can be raw data, JSON, Werkzeug Response objects, or custom functions.\n\nThe package is built on Werkzeug for HTTP parsing and request/response handling. It works both as a pytest fixture (automatically started and stopped around each test) and as a standalone context manager for non-pytest code. This approach lets you test HTTP clients in isolation without external network calls, making tests faster and more reliable.","worth_installing":"Yes, if you need to test HTTP clients. The package is actively maintained, has low install friction, and fills a clear testing gap. The only caveat is the unclear license status\u2014verify the actual license before use in proprietary projects. For open-source work or internal testing, it is a solid choice."},"id":"pytest-httpserver","links":{"html":"https://skillfed.io/packages/pytest-httpserver","md":"https://skillfed.io/packages/pytest-httpserver.md","pypi":"https://pypi.org/project/pytest-httpserver/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-02-14","license_spdx":null,"license_treatment":"unclear","name":"pytest_httpserver","python_support":"supports_current","summary":"pytest-httpserver is a httpserver for pytest"},"popularity":{"monthly_downloads":3898973,"position":2457,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.1.5"}
