From 77ac9c0dcd4ad4aa8640719f570ca993791c57e1 Mon Sep 17 00:00:00 2001 From: euri10 Date: Wed, 14 Feb 2024 21:07:21 +0100 Subject: [PATCH] Tamed mypy, aclose is definitely a Redis method, so not sure why it isn't recognized, we use types-redis --- litestar/stores/redis.py | 2 +- tests/unit/test_stores.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/litestar/stores/redis.py b/litestar/stores/redis.py index fc8a900e7f..5db5ce2720 100644 --- a/litestar/stores/redis.py +++ b/litestar/stores/redis.py @@ -73,7 +73,7 @@ def __init__( async def _shutdown(self) -> None: if self.handle_client_shutdown: - await self._redis.aclose(close_connection_pool=True) + await self._redis.aclose(close_connection_pool=True) # type: ignore[attr-defined] async def __aexit__( self, diff --git a/tests/unit/test_stores.py b/tests/unit/test_stores.py index 704fcb2ea7..36cd484f5a 100644 --- a/tests/unit/test_stores.py +++ b/tests/unit/test_stores.py @@ -6,7 +6,7 @@ import string from datetime import timedelta from pathlib import Path -from typing import TYPE_CHECKING, cast +from typing import TYPE_CHECKING, cast, Iterator from unittest.mock import MagicMock, Mock, patch import msgspec @@ -404,12 +404,12 @@ def anyio_backend() -> str: @pytest.fixture(scope="session") -def app_settings_test(): +def app_settings_test() -> AppSettings: return AppSettings(debug=True) @pytest.fixture(scope="session") -def app_test(app_settings_test: AppSettings): +def app_test(app_settings_test: AppSettings) -> Iterator[Litestar]: app = get_app(app_settings_test) yield app