httmock

A mocking library for requests in Python to test HTTP interactions.

DecliningOpen SourceLow lock-in

Pricing

Free tier

Flat rate

Adoption

Cooling

License

Open Source

Data freshness

Aging · Jun 8, 2026

Overview

What is httmock?

httmock is a Python library that allows developers to mock HTTP responses for testing purposes, supporting both Python 2.6+ and 3.2+. It simplifies the process of writing tests by enabling controlled simulation of network conditions without making actual HTTP calls.

Key differentiator

httmock stands out as a lightweight, Python-specific library for mocking HTTP responses, offering simplicity and flexibility in isolating network interactions for robust testing.

Capability profile

Capability Radar

Ease of StartEcosystemValueMaturityFlexibilityScale Ready

Honest assessment

Strengths & Weaknesses

↑ Strengths

Mocks HTTP responses for testing purposesmedium

Supports both Python 2.6+ and 3.2+medium

Simplifies writing tests by simulating network conditionsmedium

↓ Weaknesses

Limited documentation and exampleshigh

The official documentation lacks comprehensive guides and practical examples, making it difficult for new users to understand how to use the library effectively.

No active development or maintenancehigh

The last release was several years ago, indicating that the project is no longer actively maintained. This can lead to compatibility issues with newer versions of Python and other dependencies.

Complex setup for advanced scenariosmedium

Setting up complex mock responses or handling multiple URLs requires a deep understanding of the library's internal mechanisms, which may be challenging for users not familiar with its architecture.

Limited support for asynchronous testingmedium

httmock does not natively support asynchronous HTTP libraries like aiohttp, requiring additional workarounds or custom implementations to mock responses in async tests.

Fit analysis

Who is it for?

✓ Best for

Developers who need to mock HTTP responses for testing Python applications

Teams working on projects that require interaction with multiple APIs and need isolated testing environments

✕ Not a fit for

Projects requiring real-time data from external services during tests

Applications where the focus is on performance testing rather than functional testing

Cost structure

Pricing

Free Tier

Available

Open source — free to use

Starts at

$0

Model

Flat rate

Enterprise

None

Performance benchmarks

How Fast Is It?

Ecosystem

Relationships

Next step

Get Started with httmock

Step-by-step setup guide with code examples and common gotchas.

View Setup Guide →