From 365a68d90bff964d1dbaec05c4593a338f285220 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 18:04:28 +0000 Subject: [PATCH 1/2] Update dependency flake8-pytest-style to v2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7d2dc35..28e7442 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ flake8 = "^7.0.0" flake8-debugger = "^4.1.2" flake8-isort = "^6.0.0" flake8-print = "^5.0.0" -flake8-pytest-style = "^1.6.0" +flake8-pytest-style = "^2.0.0" flake8-quotes = "^3.3.2" isort = "^5.11.4" mypy = "^1.0.0" From 2e2f4452c1aaf3543f70bf4315fada38d68eb0ca Mon Sep 17 00:00:00 2001 From: Nikita Sivakov Date: Wed, 3 Apr 2024 22:39:36 +0200 Subject: [PATCH 2/2] Make linter happy --- asyncpg_engine/pytest_plugin.py | 6 +++--- tests/conftest.py | 2 +- tests/pytest_plugin/test_custom_engine_cls.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/asyncpg_engine/pytest_plugin.py b/asyncpg_engine/pytest_plugin.py index cfcbd53..0096380 100644 --- a/asyncpg_engine/pytest_plugin.py +++ b/asyncpg_engine/pytest_plugin.py @@ -11,12 +11,12 @@ def pytest_configure(config: typing.Any) -> None: config.addinivalue_line("markers", "asyncpg_engine: configure asyncpg-engine plugin behaviour.") -@pytest.fixture() +@pytest.fixture def asyncpg_engine_cls() -> typing.Type[Engine]: return Engine -@pytest_asyncio.fixture() +@pytest_asyncio.fixture async def db( request: pytest.FixtureRequest, asyncpg_engine_cls: typing.Type[Engine], postgres_url: str ) -> typing.AsyncGenerator[Engine, None]: @@ -37,7 +37,7 @@ async def db( await _db.close() -@pytest_asyncio.fixture() +@pytest_asyncio.fixture async def con(db: Engine) -> typing.AsyncGenerator[Connection, None]: async with db.acquire() as _con: yield _con diff --git a/tests/conftest.py b/tests/conftest.py index f0c201c..ac00f4e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,6 +3,6 @@ pytest_plugins = ["asyncpg_engine"] -@pytest.fixture() +@pytest.fixture def postgres_url() -> str: return "postgres://guest:guest@localhost:5432/guest?sslmode=disable" diff --git a/tests/pytest_plugin/test_custom_engine_cls.py b/tests/pytest_plugin/test_custom_engine_cls.py index 76b8bbb..81b20ba 100644 --- a/tests/pytest_plugin/test_custom_engine_cls.py +++ b/tests/pytest_plugin/test_custom_engine_cls.py @@ -11,7 +11,7 @@ class MyPrettyEngine(Engine): pass -@pytest.fixture() +@pytest.fixture def asyncpg_engine_cls() -> typing.Type[MyPrettyEngine]: return MyPrettyEngine