pytest-asyncio logo

pytest-asyncio

Pytest plugin providing fixtures and decorators for testing asynchronous Python code using asyncio, including async fixtures and event loop management.

-

Our Verdict

Essential for async Python tests, but expect to re-read the changelog every upgrade due to config churn.

Pros

  • Standard choice for async Python testing
  • Async fixtures with scope management
  • Event loop control per test or session
  • Maintained under pytest-dev umbrella

Cons

  • Frequent breaking changes across versions
  • Configuration around loop scope confuses newcomers
  • Mode settings (auto/strict) easy to misuse
Best for: Python teams testing asyncio-based code with FastAPI, aiohttp, or httpx Not for: Projects avoiding async altogether or using anyio's built-in plugin

When to Use pytest-asyncio

Good fit if you need

  • Test asyncio coroutines with async def test functions
  • Async fixtures for database connections and HTTP clients
  • Event loop configuration for FastAPI and aiohttp tests
  • Scope-aware async fixture management in test suites

pytest-asyncio Pricing

Pricing Model
free
Free Tier
Yes
Entry Price
β€”
Enterprise Available
No
Transparency Score
β€”

Beta β€” estimates may differ from actual pricing

1,000
1001K10K100K1M

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

B

Health Score

1.6k 179
Bus Factor

8

Last Commit

today

Release Freq

54d

Open Issues

58

Issue Response

N/A

License

Apache-2.0

Last checked: 2026-04-21

Lock-in Assessment

Low 5/5
Lock-in Score
5/5

πŸ”„ Thinking about migrating off pytest-asyncio?

Get an AI-drafted migration plan + a copy-paste email to pytest-asyncio support requesting a data export. Pick where you're moving to and tell us your context.

Looking for alternatives to pytest-asyncio?

Answer 4 quick questions β€” get an AI-ranked shortlist of tools that match your stack and requirements.

Open AI Tool Finder

Community Discussion

Comments powered by Giscus (GitHub Discussions). You need a GitHub account to comment.