diff --git a/poetry.lock b/poetry.lock index 13b9c916..75fbae78 100644 --- a/poetry.lock +++ b/poetry.lock @@ -522,23 +522,23 @@ testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2. [[package]] name = "pytest-asyncio" -version = "0.18.3" +version = "0.21.1" description = "Pytest support for asyncio" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-asyncio-0.18.3.tar.gz", hash = "sha256:7659bdb0a9eb9c6e3ef992eef11a2b3e69697800ad02fb06374a210d85b29f91"}, - {file = "pytest_asyncio-0.18.3-1-py3-none-any.whl", hash = "sha256:16cf40bdf2b4fb7fc8e4b82bd05ce3fbcd454cbf7b92afc445fe299dabb88213"}, - {file = "pytest_asyncio-0.18.3-py3-none-any.whl", hash = "sha256:8fafa6c52161addfd41ee7ab35f11836c5a16ec208f93ee388f752bea3493a84"}, + {file = "pytest-asyncio-0.21.1.tar.gz", hash = "sha256:40a7eae6dded22c7b604986855ea48400ab15b069ae38116e8c01238e9eeb64d"}, + {file = "pytest_asyncio-0.21.1-py3-none-any.whl", hash = "sha256:8666c1c8ac02631d7c51ba282e0c69a8a452b211ffedf2599099845da5c5c37b"}, ] [package.dependencies] -pytest = ">=6.1.0" +pytest = ">=7.0.0" typing-extensions = {version = ">=3.7.2", markers = "python_version < \"3.8\""} [package.extras] -testing = ["coverage (==6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy (==0.931)", "pytest-trio (>=0.7.0)"] +docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] +testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy (>=0.931)", "pytest-trio (>=0.7.0)"] [[package]] name = "python-dateutil" @@ -854,4 +854,4 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "0571a5e7f9915ed0bdb908047821b6de254c4df6f86216183855b1de5e7909df" +content-hash = "922d814fb2679098d6e0ccab5857e838cf0207b8ec5d058ea3a068c4707e58da" diff --git a/pyproject.toml b/pyproject.toml index bbb47795..b4f57be9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ mypy = "1.4.1" black = "23.3.0" respx = "0.19.2" pytest = "7.1.1" -pytest-asyncio = "0.18.3" +pytest-asyncio = "0.21.1" ruff = "0.0.282" isort = "5.10.1" time-machine = "^2.9.0" diff --git a/tests/conftest.py b/tests/conftest.py index 4452b7a7..dd8bbe4c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ import asyncio +from typing import Iterator import pytest @@ -6,5 +7,7 @@ @pytest.fixture(scope="session") -def event_loop() -> asyncio.AbstractEventLoop: - return asyncio.new_event_loop() +def event_loop() -> Iterator[asyncio.AbstractEventLoop]: + loop = asyncio.new_event_loop() + yield loop + loop.close()