$npx skillfedfor your agent

httmock

A mocking library for requests.

With conditionsPyPI TestingReleased Oct 20202.0M downloads / moApache-2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — httmock-1.4.0-py3-none-any.whl
v1.4.0 · released 2020-10-28 · 1 runtime deps: requests

Yes, if you need basic HTTP mocking for requests-based code and your project is on stable Python and requests versions. The dormant maintenance status means no new features or bug fixes, so verify compatibility first. For new projects or active development, consider whether a more actively maintained alternative better suits your needs.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction install with a single lightweight dependency on requests.
  • However, the package is dormant—last release was 2020-10-28, over five years ago, and no commits since 2023-09-29.
  • It still works for its stated purpose but receives no active maintenance.

License · maintenance · safety

Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), which allows commercial and private use with minimal restrictions—suitable for most projects.

last release 2020-10-28 (2116 days) · last repo commit 2023-09-29 · 472 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,973,040 downloads/mo, #3,393 on PyPI

Verify before relying

pip install httmock

from httmock import urlmatch, HTTMock
import requests

@urlmatch(netloc=r'example\.com$')
def mock_handler(url, request):
    return {'status_code': 200, 'content': 'mocked response'}

with HTTMock(mock_handler):
    r = requests.get('http://example.com/')
    print(r.content)
  • Whether the package works reliably with modern versions of requests and Python 3.10+, given the dormant maintenance status.
  • Whether urlmatch regex patterns and response handling remain compatible with current requests internals.
Same gist for agents: .md · .json

What it is and what it does

httmock is a mocking library that intercepts HTTP requests made by the requests library, letting you replace real API calls with predefined mock responses during testing. It works by decorating handler functions with urlmatch (to conditionally mock specific URLs) or all_requests (to mock all requests), then wrapping your test code in an HTTMock context manager. The library lets you return simple dictionaries or use the response() method to construct full HTTP responses with status codes, headers, and cookies.

The package is straightforward and has low install friction—it depends only on requests. However, it has been dormant since late 2020, with no active maintenance or updates. It remains functional for basic mocking tasks, but you should verify compatibility with your current Python and requests versions before relying on it in new projects.

Use it for

  • Unit test code that calls third-party REST APIs without making real network requests.
  • Mock specific API endpoints conditionally using URL patterns to test error handling and edge cases.
  • Simulate API rate-limit responses or error codes to verify your application's retry logic.
  • Test libraries or frameworks that use requests internally by intercepting their HTTP calls.
  • Verify cookie handling and response headers in requests-based code without a live server.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need basic HTTP mocking for requests-based code and your project is on stable Python and requests versions.

The dormant maintenance status means no new features or bug fixes, so verify compatibility first. For new projects or active development, consider whether a more actively maintained alternative better suits your needs.

Install

httmock on PyPI

Before you install

Low friction install with a single lightweight dependency on requests. However, the package is dormant—last release was 2020-10-28, over five years ago, and no commits since 2023-09-29. It still works for its stated purpose but receives no active maintenance.

License in practice

Licensed under Apache-2.0 (permissive), which allows commercial and private use with minimal restrictions—suitable for most projects.

Quickstart

pip install httmock

from httmock import urlmatch, HTTMock
import requests

@urlmatch(netloc=r'example\.com$')
def mock_handler(url, request):
    return {'status_code': 200, 'content': 'mocked response'}

with HTTMock(mock_handler):
    r = requests.get('http://example.com/')
    print(r.content)

Verify before relying

  • Whether the package works reliably with modern versions of requests and Python 3.10+, given the dormant maintenance status.
  • Whether urlmatch regex patterns and response handling remain compatible with current requests internals.

Package facts

LicenseApache-2.0 permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
requests
MaintenanceDormant 2,116 days since the last release
Last repo commit
First released
Downloads1,973,040 / month, #3,393 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Software Development :: Testing

Evidence: httmock-1.4.0-py3-none-any.whl

Tags

Capabilities
mock requests libraryhttp mocking for testsfake api responsesrequests mock decoratortest without network callsintercept http requestsrequests library testing
Topics
testingmockingrequests
PyPI keywords
requeststestingmock

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “mock requests library”

  • httmockIntercepts and mocks HTTP requests made by the requests library,…
  • requests-mockIntercepts and mocks HTTP requests made through the requests library,…
  • aiointerceptIntercepts aiohttp client requests by routing them through a real…

Give your agent the search over MCP, or paste the wish link into any chat.

More Testing packages

pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo
virtualenv Worth it
PyPI · Libraries · released Aug 2026

virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.

MITpure Python · 3.9+
532.9Mdownloads / mo
coverage Worth it
PyPI · Testing · released Aug 2026

Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.

Install it if you want to measure test completeness or enforce coverage thresholds in your project.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
pytest-asyncio Worth it
PyPI · Testing · released May 2026

pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.

Install it if you write tests for any asyncio-based code.

Apache-2.0pure Python · 3.10+
275.9Mdownloads / mo
pytest-json-ctrf Worth it
PyPI · Testing · released Jul 2026

A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.

Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.

MITpure Python · 3.8+
273.0Mdownloads / mo

See also mocket · pytest-responses · smithy-http · wiremock · pook · aiointercept · requests-mock · responses · flexmock · http-exceptions