aioresponses
Mock out requests made by ClientSession from aiohttp package
Decision gist · record as of 2026-08-14
Yes. aioresponses is a focused, well-maintained tool for a common testing need in async Python. It has no known vulnerabilities, low install friction, a permissive license, and active development. Install it if you write tests for code using aiohttp.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10+ and aiohttp>=3.8,<4.0
- Low friction install with just two runtime dependencies (packaging and aiohttp).
- Actively maintained with a recent release; repository shows steady activity and moderate community engagement.
License · maintenance · safety
permissive license (permissive) — Permissive license allows unrestricted use in commercial and open-source projects without copyleft obligations.
last release 2026-06-23 (52 days) · last repo commit 2026-06-23 · 557 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 9,319,461 downloads/mo, #1,546 on PyPI
Alternatives
Verify before relying
pip install aioresponses
from aioresponses import aioresponses
import aiohttp
import asyncio
@aioresponses()
def test_example(mocked):
mocked.get('http://example.com', status=200, body='test')
session = aiohttp.ClientSession()
resp = asyncio.run(session.get('http://example.com'))
assert resp.status == 200- Whether the package supports Python 3.14 in practice (listed as classifier but may be aspirational)
What it is and what it does
aioresponses is a testing helper that intercepts and mocks HTTP requests made by aiohttp's ClientSession, letting you test asynchronous code without hitting real servers. It works as a decorator or context manager and lets you specify mock responses by URL, including status codes, JSON payloads, headers, and exceptions. You can also use regex patterns to match URLs, repeat responses for retry testing, simulate redirects, or pass through to real servers selectively.
The package fills a gap in the async testing ecosystem—while synchronous HTTP libraries have many mocking options, aioresponses makes it straightforward to test async code that uses aiohttp. It depends on aiohttp and packaging, both common in Python projects. The library is actively maintained and has been stable since its early releases.
Use it for
- Test async functions that call external APIs without making real network requests
- Verify retry logic by mocking the same URL to return different status codes in sequence
- Mock JSON API responses to test data parsing in async code
- Simulate HTTP errors and exceptions to test error handling in async workflows
- Test redirect handling by mocking Location headers with 3xx status codes
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
aioresponses is a focused, well-maintained tool for a common testing need in async Python. It has no known vulnerabilities, low install friction, a permissive license, and active development. Install it if you write tests for code using aiohttp.
Install
aioresponses on PyPI
Before you install
Low friction install with just two runtime dependencies (packaging and aiohttp). Actively maintained with a recent release; repository shows steady activity and moderate community engagement.
Requires Python 3.10+ and aiohttp>=3.8,<4.0
License in practice
Permissive license allows unrestricted use in commercial and open-source projects without copyleft obligations.
Quickstart
pip install aioresponses
from aioresponses import aioresponses
import aiohttp
import asyncio
@aioresponses()
def test_example(mocked):
mocked.get('http://example.com', status=200, body='test')
session = aiohttp.ClientSession()
resp = asyncio.run(session.get('http://example.com'))
assert resp.status == 200
Verify before relying
- Whether the package supports Python 3.14 in practice (listed as classifier but may be aspirational)
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespackagingaiohttp |
| Maintenance | Actively maintained 52 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 9,319,461 / month, #1,546 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTPTopic :: Software Development :: TestingTopic :: Software Development :: Testing :: Mocking |
Evidence: aioresponses-0.7.9-py2.py3-none-any.whl
Tags
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 › “fake async web requests”
- aioresponsesMocks HTTP requests made by aiohttp's ClientSession for testing…
- fake-headersGenerates realistic User-Agent strings and HTTP headers locally…
- fake-useragentGenerates random or browser-specific user-agent strings from a…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also aiohttp-xmlrpc · aiointercept · aresponses · requests-mock · responses · aiohttp-client-cache · urllib3-mock · pytest-aiohttp · aiohttp-asgi-connector