Skip to main content

set up asynchronous pytest fixtures concurrently

Project description

Pytest-Gather-Fixtures: run async fixtures concurrently

pytest-gather-fixtures is a library for pytest that allows you to set up and tear down fixtures in parallel. It's useful for when you have multiple independent fixtures that take a long time to set up.

import asyncio
from pytest_gather_fixtures import ConcurrentFixtureGroup

my_fixture_group = ConcurrentFixtureGroup('my_fixture_group')

async def my_fixture_1():
    await asyncio.sleep(1)

async def my_fixture_2():
    await asyncio.sleep(1)

def test_foo(my_fixture_1, my_fixture_2):
    # setup for this test will only take 1 second

Project details

Download files

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

Source Distribution

pytest-gather-fixtures-0.1.1.tar.gz (5.9 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page