From e643b1ccac4b3b3cea38798c6d975f322a435360 Mon Sep 17 00:00:00 2001 From: Cody Fincher Date: Tue, 14 Jan 2025 18:00:23 +0000 Subject: [PATCH] fix: linting --- .env.testing | 2 +- src/app/db/models/team_tag.py | 4 +--- tests/helpers.py | 10 +++++----- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.env.testing b/.env.testing index 30fb6ccf..bb8c68f1 100644 --- a/.env.testing +++ b/.env.testing @@ -16,4 +16,4 @@ VITE_HOST=localhost VITE_PORT=3006 VITE_HOT_RELOAD=True VITE_DEV_MODE=True -VITE_USE_SERVER_LIFESPAN=False \ No newline at end of file +VITE_USE_SERVER_LIFESPAN=False diff --git a/src/app/db/models/team_tag.py b/src/app/db/models/team_tag.py index 50f3a859..c5540ec0 100644 --- a/src/app/db/models/team_tag.py +++ b/src/app/db/models/team_tag.py @@ -1,11 +1,9 @@ from __future__ import annotations -from typing import Final - from advanced_alchemy.base import orm_registry from sqlalchemy import Column, ForeignKey, Table -team_tag: Final[Table] = Table( +team_tag = Table( "team_tag", orm_registry.metadata, Column("team_id", ForeignKey("team.id", ondelete="CASCADE"), primary_key=True), diff --git a/tests/helpers.py b/tests/helpers.py index 9801936a..f6d3569b 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -5,7 +5,7 @@ from functools import partial from typing import TYPE_CHECKING, TypeVar, cast, overload -import anyio +from anyio import to_thread from typing_extensions import ParamSpec if TYPE_CHECKING: @@ -17,11 +17,11 @@ class _ContextManagerWrapper: - def __init__(self, cm: AbstractContextManager[T]) -> None: + def __init__(self, cm: AbstractContextManager[object]) -> None: self._cm = cm - async def __aenter__(self) -> T: - return self._cm.__enter__() # type: ignore[return-value] + async def __aenter__(self) -> object: + return self._cm.__enter__() async def __aexit__( self, @@ -55,6 +55,6 @@ def wrap_sync(fn: Callable[P, T]) -> Callable[P, Awaitable[T]]: return fn async def wrapped(*args: P.args, **kwargs: P.kwargs) -> T: - return await anyio.to_thread.run_sync(partial(fn, *args, **kwargs)) + return await to_thread.run_sync(partial(fn, *args, **kwargs)) return wrapped