Skip to main content

Run all your asynchronous tests cooperatively.

Project description

Use asyncio (cooperative multitasking) to run your I/O bound test suite efficiently and quickly.

import asyncio

import pytest

async def test_a():
    await asyncio.sleep(2)

async def test_b():
    await asyncio.sleep(2)
========== 2 passed in 2.05 seconds ==========


pip install pytest-asyncio-cooperative


  • Reduce the total run time of I/O bound test suites via cooperative multitasking
  • Reduce system resource usage via cooperative multitasking


  • An I/O bound test suite will run faster (ie. individual tests will take just as long. The total runtime of the entire test suite will be faster)
  • An I/O bound test suite will use less system resources (ie. only a single thread is used)


  • All tests MUST be coroutines (ie. have the async keyword)
  • Order of tests is not guaranteed (ie. some blocking operations might taken longer and affect the order of test results)
  • Tests MUST be isolated from each other (ie. NO shared resources, NO mock.patch)
  • There is NO parallelism, CPU bound tests will NOT get a performance benefit

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytest-asyncio-cooperative, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size pytest_asyncio_cooperative-0.4.0-py3-none-any.whl (8.5 kB) File type Wheel Python version 3.7 Upload date Hashes View
Filename, size pytest-asyncio-cooperative-0.4.0.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page