diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4e5d2f8e..ed7d0cb0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: hooks: - id: yesqa - repo: https://github.com/Zac-HD/shed - rev: 0.10.7 + rev: 2024.1.1 hooks: - id: shed args: diff --git a/pytest_asyncio/__init__.py b/pytest_asyncio/__init__.py index 95046981..08dca478 100644 --- a/pytest_asyncio/__init__.py +++ b/pytest_asyncio/__init__.py @@ -1,4 +1,5 @@ """The main point for importing pytest-asyncio items.""" + from ._version import version as __version__ # noqa from .plugin import fixture, is_async_test diff --git a/pytest_asyncio/plugin.py b/pytest_asyncio/plugin.py index c0147ffb..b0744f0d 100644 --- a/pytest_asyncio/plugin.py +++ b/pytest_asyncio/plugin.py @@ -1,4 +1,5 @@ """pytest-asyncio implementation.""" + import asyncio import contextlib import enum @@ -115,8 +116,7 @@ def fixture( None, ] = ..., name: Optional[str] = ..., -) -> FixtureFunction: - ... +) -> FixtureFunction: ... @overload @@ -132,8 +132,7 @@ def fixture( None, ] = ..., name: Optional[str] = None, -) -> FixtureFunctionMarker: - ... +) -> FixtureFunctionMarker: ... def fixture( @@ -720,9 +719,9 @@ def pytest_generate_tests(metafunc: Metafunc) -> None: # The fixture needs to be appended to avoid messing up the fixture evaluation # order metafunc.fixturenames.append(event_loop_fixture_id) - metafunc._arg2fixturedefs[ - event_loop_fixture_id - ] = fixturemanager._arg2fixturedefs[event_loop_fixture_id] + metafunc._arg2fixturedefs[event_loop_fixture_id] = ( + fixturemanager._arg2fixturedefs[event_loop_fixture_id] + ) @pytest.hookimpl(hookwrapper=True) diff --git a/tests/async_fixtures/test_async_fixtures_scope.py b/tests/async_fixtures/test_async_fixtures_scope.py index 079a981a..a25934a8 100644 --- a/tests/async_fixtures/test_async_fixtures_scope.py +++ b/tests/async_fixtures/test_async_fixtures_scope.py @@ -2,6 +2,7 @@ We support module-scoped async fixtures, but only if the event loop is module-scoped too. """ + import asyncio import pytest diff --git a/tests/hypothesis/test_base.py b/tests/hypothesis/test_base.py index c2a7ea6a..fa12f2b3 100644 --- a/tests/hypothesis/test_base.py +++ b/tests/hypothesis/test_base.py @@ -1,6 +1,7 @@ """Tests for the Hypothesis integration, which wraps async functions in a sync shim for Hypothesis. """ + from textwrap import dedent import pytest diff --git a/tests/loop_fixture_scope/test_loop_fixture_scope.py b/tests/loop_fixture_scope/test_loop_fixture_scope.py index 679ab48f..eb4be8c9 100644 --- a/tests/loop_fixture_scope/test_loop_fixture_scope.py +++ b/tests/loop_fixture_scope/test_loop_fixture_scope.py @@ -1,4 +1,5 @@ """Unit tests for overriding the event loop with a larger scoped one.""" + import asyncio import pytest diff --git a/tests/markers/test_class_scope.py b/tests/markers/test_class_scope.py index fa2fe81e..9ec3ed9c 100644 --- a/tests/markers/test_class_scope.py +++ b/tests/markers/test_class_scope.py @@ -1,4 +1,5 @@ """Test if pytestmark works when defined on a class.""" + import asyncio from textwrap import dedent diff --git a/tests/test_simple.py b/tests/test_simple.py index 05c92694..f5f52a8d 100644 --- a/tests/test_simple.py +++ b/tests/test_simple.py @@ -1,4 +1,5 @@ """Quick'n'dirty unit tests for provided fixtures and markers.""" + import asyncio from textwrap import dedent diff --git a/tests/test_subprocess.py b/tests/test_subprocess.py index f60b2824..3d91e7b1 100644 --- a/tests/test_subprocess.py +++ b/tests/test_subprocess.py @@ -1,4 +1,5 @@ """Tests for using subprocesses in tests.""" + import asyncio.subprocess import sys