From 23bb4e9cd47de02223dc316afa6a3176382bb6d5 Mon Sep 17 00:00:00 2001 From: Martijn Pieters Date: Tue, 16 May 2023 13:45:26 +0100 Subject: [PATCH] Add pytest-style linting (#159) This does mean we need to tell pyright that the init_cache auto-use fixture is still being used even though it now has a leading underscore. --- tests/pyproject.toml | 3 +++ tests/test_decorator.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/pyproject.toml b/tests/pyproject.toml index 273ca7f..d49f4fd 100644 --- a/tests/pyproject.toml +++ b/tests/pyproject.toml @@ -1,5 +1,8 @@ [tool.ruff] extend = "../pyproject.toml" +extend-select = [ + "PT", # flake8-pytest-style +] ignore = ["S101"] [tool.ruff.isort] diff --git a/tests/test_decorator.py b/tests/test_decorator.py index ba86fd5..fefa182 100644 --- a/tests/test_decorator.py +++ b/tests/test_decorator.py @@ -11,7 +11,7 @@ from fastapi_cache.backends.inmemory import InMemoryBackend @pytest.fixture(autouse=True) -def init_cache() -> Generator[Any, Any, None]: +def _init_cache() -> Generator[Any, Any, None]: # pyright: ignore[reportUnusedFunction] FastAPICache.init(InMemoryBackend()) yield FastAPICache.reset()