requests-mock
Transport adapter that can mock out the Python requests library at the adapter level, useful for stubbing complex HTTP interactions.
Our Verdict
A solid choice for requests-based tests, though httpx users need respx and many teams prefer responses instead.
Pros
- Mocks Python requests at the adapter level
- Granular control over URL matching
- Works as pytest fixture or decorator
- No network needed for deterministic tests
Cons
- Only works with requests library, not httpx
- responses library is often considered simpler
- Requires careful adapter scope management
When to Use requests-mock
Good fit if you need
- Stub HTTP responses at the transport adapter layer
- Context manager-based mocking for Python requests tests
- Complex request matching with headers and body patterns
- Prevent live API calls in Python integration test suites
Pricing
Price wrong?requests-mock Pricing
- Pricing Model
- free
- Free Tier
- Yes
- Entry Price
- β
- Enterprise Available
- No
- Transparency Score
- β
Beta β estimates may differ from actual pricing
Estimated Monthly Cost
$25
Estimated Annual Cost
$300
Estimates are approximate and may not reflect current pricing. Always check the official pricing page.
Project Health
Health Score
2
1.8 years
259d
67
0d
Apache-2.0
Last checked: 2026-04-21
Lock-in Assessment
π Thinking about migrating off requests-mock?
Get an AI-drafted migration plan + a copy-paste email to requests-mock support requesting a data export. Pick where you're moving to and tell us your context.
Looking for alternatives to requests-mock?
Answer 4 quick questions β get an AI-ranked shortlist of tools that match your stack and requirements.
Open AI Tool FinderCommunity Discussion
Comments powered by Giscus (GitHub Discussions). You need a GitHub account to comment.