pytest-trio
Pytest plugin for trio
Decision gist · record as of 2026-08-14
Yes, if you are testing Trio-based code. The plugin is stable, well-integrated with pytest, and carries no security vulnerabilities. The aging maintenance (last release November 2022) is a minor concern but not a blocker—the project remains unarchived and the core functionality is mature. Install it as a dev dependency for any project using Trio.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.7 or later; Trio must be installed as a runtime dependency.
- Low install friction with a pure-Python wheel.
- Maintenance is aging—last release was in November 2022 and no commits since October 2025—but the repository remains active and unarchived, suggesting the project is stable rather than abandoned.
License · maintenance · safety
MIT OR Apache-2.0 (permissive) — Licensed under MIT or Apache 2.0 at your choice, both permissive licenses with no restrictions on commercial or private use.
last release 2022-11-01 (1382 days) · last repo commit 2025-10-08 · 61 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 394,538 downloads/mo, #6,990 on PyPI
Alternatives
Verify before relying
pip install pytest-trio
import trio
import pytest
@pytest.mark.trio
async def test_example():
await trio.sleep(0)- Whether the aging maintenance status (last release Nov 2022) affects compatibility with recent Trio or pytest versions.
- Current test coverage and whether the plugin handles all Trio cancellation and timeout patterns.
What it is and what it does
pytest-trio is a pytest plugin that bridges the gap between pytest's synchronous test runner and Trio's async I/O library. It lets you write test functions as async coroutines and run them directly under pytest, handling the event loop setup and teardown automatically. The plugin depends on trio, outcome, and pytest.
The package is designed for projects already using Trio for concurrency and async I/O. Instead of writing wrapper functions or manually managing the event loop in tests, you mark async test functions with @pytest.mark.trio and pytest-trio runs them in a Trio context. It integrates with pytest's fixture system and supports Hypothesis for property-based testing of async code.
Use it for
- Write async unit tests for Trio-based libraries without manual event loop management.
- Test concurrent I/O operations and async functions in isolation using pytest fixtures.
- Run property-based tests on async code via Hypothesis integration.
- Validate error handling and cancellation behavior in async Trio applications.
- Integrate async testing into existing pytest test suites without restructuring.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are testing Trio-based code.
The plugin is stable, well-integrated with pytest, and carries no security vulnerabilities. The aging maintenance (last release November 2022) is a minor concern but not a blocker—the project remains unarchived and the core functionality is mature. Install it as a dev dependency for any project using Trio.
Install
pytest-trio on PyPI
Before you install
Low install friction with a pure-Python wheel. Maintenance is aging—last release was in November 2022 and no commits since October 2025—but the repository remains active and unarchived, suggesting the project is stable rather than abandoned.
Requires Python 3.7 or later; Trio must be installed as a runtime dependency.
License in practice
Licensed under MIT or Apache 2.0 at your choice, both permissive licenses with no restrictions on commercial or private use.
Quickstart
pip install pytest-trio
import trio
import pytest
@pytest.mark.trio
async def test_example():
await trio.sleep(0)
Verify before relying
- Whether the aging maintenance status (last release Nov 2022) affects compatibility with recent Trio or pytest versions.
- Current test coverage and whether the plugin handles all Trio cancellation and timeout patterns.
Package facts
| License | MIT OR Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagestriooutcomepytest |
| Maintenance | Aging 1,382 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 394,538 / month, #6,990 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Framework :: HypothesisFramework :: PytestFramework :: TrioLicense :: OSI Approved :: Apache Software LicenseLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: TestingTopic :: System :: Networking |
Evidence: pytest_trio-0.8.0-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 › “pytest async testing”
- pytest-trioA pytest plugin that enables testing of async code written with Trio,…
- pytest-asynciopytest-asyncio is a pytest plugin that enables writing and running…
- pytest-tornasyncA pytest plugin that runs native async test functions (defined with…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
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.
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.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
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.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
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.
See also pytest-aio · trio · sniffio · async_generator · pytest-run-parallel · outcome · flake8-async · unasync · pytest-twisted · pytest-django