RESPX

HTTP mocking library for Python's httpx client. RESPX intercepts httpx requests in tests and returns mocked responses without making real network calls. The async-native equivalent of responses (for requests) but designed for httpx. Essential for testing agent code that makes HTTP calls without hitting real APIs.

Evaluated Mar 07, 2026 (0d ago) v0.21+
Homepage ↗ Repo ↗ Developer Tools python testing httpx mocking async http responder
⚙ Agent Friendliness
67
/ 100
Can an agent use this?
🔒 Security
98
/ 100
Is it safe for agents?
⚡ Reliability
89
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
82
Error Messages
82
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
90
Secret Handling
100

Testing library that prevents real network calls during tests — actually improves security by not hitting real APIs in test environments.

⚡ Reliability

Uptime/SLA
100
Version Stability
85
Breaking Changes
82
Error Recovery
88
AF Security Reliability

Best When

Your agent code uses httpx for HTTP and you need clean, async-native HTTP mocking in pytest tests.

Avoid When

Your code uses requests (not httpx) — use the responses library. For httpx, RESPX is the best choice.

Use Cases

  • Mock external API calls in agent unit tests that use httpx for HTTP requests
  • Test agent error handling by simulating API failures, timeouts, and status codes with RESPX
  • Assert that agent code makes expected HTTP calls with correct URLs, headers, and payloads
  • Test async agent workflows that make multiple API calls with controlled mock responses
  • Build deterministic agent test suites that don't depend on external API availability

Not For

  • requests library mocking — use responses or responses-mock for requests (not httpx)
  • Integration testing against real APIs — use actual API calls or vcr-cassette recording
  • aiohttp mocking — use aioresponses for aiohttp client mocking

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Testing library — no authentication.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Completely free and open source.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • RESPX mocks httpx transports — only works with httpx clients; does not intercept requests, urllib3, or aiohttp
  • respx.mock() as context manager vs @respx.mock decorator — context manager for async tests, decorator for sync and async; mixing causes unmocked calls to leak
  • Unmatched routes raise httpx.ConnectError by default (assert_all_mocked=True) — in test setup this prevents real network calls but can be unexpected
  • Route matching is order-sensitive — more specific routes must be added before generic catch-all routes
  • Response side effects (raising exceptions) use side_effect= parameter — raising timeout or connection errors requires explicit side effect pattern
  • RESPX doesn't record/replay real responses — for cassette-style recording use pytest-recording or VCR.py with httpx support

Alternatives

Full Evaluation Report

Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for RESPX.

AI-powered analysis · PDF + markdown · Delivered within 30 minutes

$99

Package Brief

Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.

Delivered within 10 minutes

$3

Score Monitoring

Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.

Continuous monitoring

$3/mo

Scores are editorial opinions as of 2026-03-07.

6228
Packages Evaluated
26150
Need Evaluation
173
Need Re-evaluation
Community Powered