$npx skillfedfor your agent

pytest-asyncio

Pytest support for asyncio

Worth itPyPI TestingReleased May 2026275.9M downloads / moApache-2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pytest_asyncio-1.4.0-py3-none-any.whl
v1.4.0 · released 2026-05-26 · Python >=3.10 · 3 runtime deps: backports-asyncio-runner, pytest, typing-extensions

Yes. pytest-asyncio is the standard pytest plugin for async testing, actively maintained, permissively licensed, and has no known vulnerabilities. Install it if you write tests for any asyncio-based code. The only condition is that your Python version is 3.10 or later.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later.
  • Low friction installation with a pure-Python wheel.
  • The package is actively maintained with a recent release (80 days ago) and has been in development since 2015.

License · maintenance · safety

Apache-2.0 (permissive) — Licensed under Apache License 2.0 (permissive), which allows use in commercial and proprietary projects with minimal restrictions.

last release 2026-05-26 (80 days) · last repo commit 2026-08-12 · 1,656 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 275,917,521 downloads/mo, #146 on PyPI

Verify before relying

pip install pytest-asyncio

# In your test file:
import pytest

@pytest.mark.asyncio
async def test_async_code():
    result = await some_async_function()
    assert result == expected
  • Whether event loop management and fixture setup for async tests is documented sufficiently for new users.
  • Support for async test classes or whether unittest.IsolatedAsyncioTestCase is the recommended alternative.
Same gist for agents: .md · .json

What it is and what it does

pytest-asyncio bridges pytest and Python's asyncio library, letting you write test functions as async coroutines and await asynchronous code directly within them. Instead of wrapping async calls in synchronous test harnesses, you mark a test with @pytest.mark.asyncio and write it as an async function, making async test code read naturally and reducing boilerplate.

The plugin handles event loop setup and teardown automatically. It depends on pytest, typing-extensions, and backports-asyncio-runner to support older Python versions. The package is production-stable, actively maintained, and widely used—it ranks in the top 1000 PyPI packages by download volume.

Use it for

  • Testing async web frameworks (FastAPI, aiohttp, Starlette) by awaiting request handlers and assertions.
  • Unit testing async database clients or ORMs that use asyncio for non-blocking I/O.
  • Integration testing microservices or async message queues without blocking the test runner.
  • Testing async generator functions and context managers in your own asyncio-based libraries.
  • Running concurrent test scenarios that require multiple coroutines to execute in the same event loop.

Worth the install?

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

Worth it

Yes.

pytest-asyncio is the standard pytest plugin for async testing, actively maintained, permissively licensed, and has no known vulnerabilities. Install it if you write tests for any asyncio-based code. The only condition is that your Python version is 3.10 or later.

Install

pytest-asyncio on PyPI

Before you install

Low friction installation with a pure-Python wheel. The package is actively maintained with a recent release (80 days ago) and has been in development since 2015. Runtime dependencies are minimal: pytest, typing-extensions, and backports-asyncio-runner.

Requires Python 3.10 or later.

License in practice

Licensed under Apache License 2.0 (permissive), which allows use in commercial and proprietary projects with minimal restrictions.

Quickstart

pip install pytest-asyncio

# In your test file:
import pytest

@pytest.mark.asyncio
async def test_async_code():
    result = await some_async_function()
    assert result == expected

Verify before relying

  • Whether event loop management and fixture setup for async tests is documented sufficiently for new users.
  • Support for async test classes or whether unittest.IsolatedAsyncioTestCase is the recommended alternative.

Package facts

LicenseApache-2.0 permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
3 packages
backports-asyncio-runnerpytesttyping-extensions
MaintenanceActively maintained 80 days since the last release
Last repo commit
First released
Downloads275,917,521 / month, #146 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableFramework :: AsyncIOFramework :: PytestIntended Audience :: DevelopersProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: TestingTyping :: Typed

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

Tags

Capabilities
pytest async test supportasyncio testing pluginasync await in pytestcoroutine test functionspytest asyncio decoratorasync test runnerpytest async fixtures
Topics
async-testingpytest-pluginasyncio

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 › “pytest async test support”

  • pytest-asynciopytest-asyncio is a pytest plugin that enables writing and running…
  • pytest-aiohttpPytest plugin that provides fixtures for testing aiohttp applications…
  • pytest-trioA pytest plugin that enables testing of async code written with Trio,…

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-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
pytest-cov Worth it
PyPI · Utilities · released Mar 2026

A pytest plugin that measures code coverage during test runs, automatically combining coverage data and supporting distributed testing with pytest-xdist.

Install it if you want coverage reports as part of your normal test workflow.

MITpure Python · 3.9+
235.9Mdownloads / mo

See also aiounittest · asyncmock · asynctest · pytest-aiohttp · pytest-asyncio-concurrent · pytest-twisted · looptime · pytest-playwright-asyncio · pytest-tornasync