并发设置异步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-py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 6fbc9aa491d5f1cdb96bc59f71d7158d5880bf420ed0772e028697b8e955261a |
|
MD5 | c450bc8701e64752422fad1ae68e2dca |
|
BLAKE2b-256 | c924b46f9efd1aeddbbe33285847fb40d99da48a336d2161b3768d16c7a74477 |