{"id":27297,"library":"pytest-async","title":"pytest-async","description":"pytest-async is a lightweight Pytest plugin for testing async functions. It automatically runs coroutines in an event loop without requiring decorators like @pytest.mark.asyncio. Current version 0.1.1 targets Python >=3.6. It is in maintenance mode with limited updates.","status":"maintenance","version":"0.1.1","language":"python","source_language":"en","source_url":"https://github.com/hyperleex/pytest-async","tags":["pytest","async","testing","plugin"],"install":[{"cmd":"pip install pytest-async==0.1.1","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required as a test framework plugin.","package":"pytest","optional":false}],"imports":[{"note":"The plugin is automatically loaded by Pytest; explicit import only needed for configuration.","wrong":"","symbol":"pytest_async","correct":"import pytest_async"}],"quickstart":{"code":"# test_async.py\nasync def test_async_func():\n    assert await some_async_call()\n\nasync def some_async_call():\n    return 42","lang":"python","description":"Define async test functions directly; no decorator needed. Pytest automatically runs them in an event loop."},"warnings":[{"fix":"Use synchronous fixtures or mark non-test async functions with @pytest.fixture but note that pytest-async may still attempt to run them. Consider using pytest-asyncio for more control.","message":"pytest-async automatically runs ALL coroutines in tests, including fixtures. Avoid defining async fixtures that are not meant to be tests, as they may be executed inadvertently.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Migrate to pytest-asyncio: install pytest-asyncio, remove pytest-async, and add @pytest.mark.asyncio decorator to async tests.","message":"pytest-async is no longer actively maintained. The recommended alternative is pytest-asyncio, which is actively developed and supports Python 3.7+.","severity":"deprecated","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Upgrade to Python 3.8 or lower, or switch to pytest-asyncio.","cause":"pytest-async 0.1.1 uses deprecated collections imports not compatible with Python 3.9+.","error":"DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working"},{"fix":"Ensure test function is defined with 'async def' and that pytest-async is installed correctly. If using pytest-asyncio, add @pytest.mark.asyncio.","cause":"Test function is not properly awaited; possible mixing with synchronous test runner.","error":"TypeError: object NoneType can't be used in 'await' expression"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}