mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-11-10 12:29:49 +03:00
3b084a165b
* configure isort to add the future annotations import * apply the new isort setting * remove type ignores for new mypy (#13539) https://pypi.org/project/mypy/0.981/ * another
18 lines
591 B
Python
18 lines
591 B
Python
from __future__ import annotations
|
|
|
|
import asyncio
|
|
from typing import Iterator
|
|
|
|
import pytest
|
|
|
|
|
|
# This is an optimization to reduce runtime by reducing setup and teardown on the
|
|
# wallet nodes fixture below.
|
|
# https://github.com/pytest-dev/pytest-asyncio/blob/v0.18.1/pytest_asyncio/plugin.py#L479-L484
|
|
@pytest.fixture(scope="module")
|
|
def event_loop(request: "pytest.FixtureRequest") -> Iterator[asyncio.AbstractEventLoop]:
|
|
"""Create an instance of the default event loop for each test case."""
|
|
loop = asyncio.get_event_loop_policy().new_event_loop()
|
|
yield loop
|
|
loop.close()
|