py-libp2p/tests/network/conftest.py

26 lines
606 B
Python
Raw Normal View History

2019-09-09 16:58:58 +08:00
import pytest
from libp2p.tools.factories import (
2019-09-17 23:38:11 +08:00
net_stream_pair_factory,
swarm_conn_pair_factory,
swarm_pair_factory,
)
2019-09-09 16:58:58 +08:00
@pytest.fixture
2019-09-14 23:37:01 +08:00
async def net_stream_pair(is_host_secure):
async with net_stream_pair_factory(is_host_secure) as net_stream_pair:
yield net_stream_pair
2019-09-14 23:37:01 +08:00
@pytest.fixture
async def swarm_pair(is_host_secure):
async with swarm_pair_factory(is_host_secure) as swarms:
yield swarms
2019-09-17 23:38:11 +08:00
@pytest.fixture
async def swarm_conn_pair(is_host_secure):
async with swarm_conn_pair_factory(is_host_secure) as swarm_conn_pair:
yield swarm_conn_pair