--- id: pytest-asyncio-concurrent version: "0.5.2" license: The MIT License (MIT) Copyright (c) 2024 Zane Chen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),… (full text in the JSON record) license_treatment: permissive maintenance: active --- # pytest-asyncio-concurrent — Pytest plugin to execute python async tests concurrently. License: permissive · Maintenance: active · Downloads: 92.0K/mo ## What it is and what it does pytest-asyncio-concurrent is a pytest plugin that runs async test functions concurrently in groups rather than sequentially, designed to speed up I/O or network-bound test suites. It extends pytest's test loop to batch setup, call, and teardown phases for all tests in a group, then executes them concurrently within that group using asyncio. Tests are grouped by their parent scope (e.g., all methods in a class, all functions in a file), and you can explicitly assign tests to named groups via the `asyncio_concurrent` mark or rely on a default grouping strategy. The plugin accepts a `timeout` parameter on the mark to fail tests that exceed a time limit, and supports configuration via CLI flags or pytest config files. It works alongside pytest and is compatible with parametrized tests. The trade-off is that concurrent execution breaks the test isolation principle for non-function-scoped fixtures, so you must verify your tests are safe to run concurrently before using it. Use it for: - Speed up integration test suites with many async I/O or network calls by running independent tests concurrently within the same class or module. - Reduce total test runtime for parametrized async tests by executing all parameter variants of a test concurrently when grouped. - Add per-test timeouts to catch hung async operations without blocking the entire test suite. - Run async tests concurrently while maintaining isolation at the group level, suitable for microservice or API test scenarios. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that executes async test functions concurrently rather than sequentially, grouped by parent scope to control which tests run together. Yes, if your test suite contains many async I/O-bound tests and you have verified that concurrent execution does not violate your fixture assumptions. The plugin is actively maintained, has no known vulnerabilities, and low install friction. Start with explicit grouping to control which tests run together, then validate that shared fixtures behave correctly under concurrent execution before relying on default grouping. ## Install pip install pytest-asyncio-concurrent uv add pytest-asyncio-concurrent poetry add pytest-asyncio-concurrent ## Installing pytest-asyncio-concurrent Before you install: Low friction: pure Python wheel with only pytest as a runtime dependency. Active maintenance with recent commits; marked Beta but in use since late 2024. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects. Quickstart: pip install pytest-asyncio-concurrent @pytest.mark.asyncio_concurrent(group="my_group") async def test_example(): res = await wait_for_something_async() assert result.is_valid() Requires Python 3.8 or later; concurrent execution breaks test isolation for non-function-scoped fixtures, so tests must be verified safe to run concurrently. Verify before relying: - Whether concurrent execution within a group truly eliminates fixture isolation concerns or merely defers them to group boundaries. - Performance gains on typical test suites and whether the overhead of group batching justifies concurrent execution for smaller test sets. - Compatibility edge cases with pytest plugins that also hook pytest_runtestloop. ## Package facts - License: The MIT License (MIT) Copyright (c) 2024 Zane Chen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 92.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest async concurrent execution, parallel async tests pytest, pytest asyncio concurrent groups, speed up async test suite, concurrent pytest async functions, pytest async grouping plugin, parallel I/O bound tests, async-testing, test-performance, pytest-plugin [View on SkillFed](https://skillfed.io/packages/pytest-asyncio-concurrent) · [View on PyPI](https://pypi.org/project/pytest-asyncio-concurrent/)