跳转到主要内容

并发设置异步pytest fixtures

项目描述

Pytest-Gather-Fixtures:并行运行async fixtures

文档

pytest-gather-fixtures 是一个pytest库,允许您并行设置和销毁 fixtures。当您有多个耗时较长的独立 fixtures 时,它非常有用。

import asyncio
from pytest_gather_fixtures import ConcurrentFixtureGroup

my_fixture_group = ConcurrentFixtureGroup('my_fixture_group')

@my_fixture_group.fixture
async def my_fixture_1():
    await asyncio.sleep(1)

@my_fixture_group.fixture
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
    pass

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

pytest_gather_fixtures-0.2.1.tar.gz (6.2 kB 查看哈希值)

上传时间

构建分发

pytest_gather_fixtures-0.2.1-py3-none-any.whl (7.0 kB 查看哈希值)

上传时间 Python 3

由以下支持