From 92a9a0cd09ce6b949e2fbfa99f835419f2b4e5c8 Mon Sep 17 00:00:00 2001 From: jk Date: Sat, 13 Jan 2024 22:04:25 +0100 Subject: [PATCH 1/2] remove pydantic and pytest-asyncio deprecation warnings --- shortener/settings.py | 7 ++----- tests/conftest.py | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/shortener/settings.py b/shortener/settings.py index 8966356..362fb80 100644 --- a/shortener/settings.py +++ b/shortener/settings.py @@ -4,14 +4,11 @@ class PostgresSettings(BaseSettings): """Settings for postgres connection.""" + model_config = {"env_prefix": "DB_", "env_file": ".env", "env_file_encoding": "utf-8"} + host: str = "localhost" port: int = 5432 database: str = "postgres" user: str = "localuser" password: str = "password123" ssl: bool = False - - class Config: - env_prefix = "DB_" - env_file = ".env" - env_file_encoding = "utf-8" diff --git a/tests/conftest.py b/tests/conftest.py index 78f3fec..259a53b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -15,7 +15,7 @@ async def test_client(): async_pool = asyncpg.create_pool(min_size=5, max_size=25, **dict(PostgresSettings(_env_file=None))) async with async_pool as pool: app.pool = pool - with TestClient(app=app, backend_options={"use_uvloop": True}) as client: + with TestClient(app=app) as client: yield client return From c7e13ce959d67ee9c7f8c0a17674789b9729c389 Mon Sep 17 00:00:00 2001 From: jk Date: Sat, 13 Jan 2024 22:04:48 +0100 Subject: [PATCH 2/2] pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6301b2f..1efde17 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - --line-length=120 - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 args: