mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-24 20:47:54 +00:00
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.
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
extend = "../pyproject.toml"
|
extend = "../pyproject.toml"
|
||||||
|
extend-select = [
|
||||||
|
"PT", # flake8-pytest-style
|
||||||
|
]
|
||||||
ignore = ["S101"]
|
ignore = ["S101"]
|
||||||
|
|
||||||
[tool.ruff.isort]
|
[tool.ruff.isort]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from fastapi_cache.backends.inmemory import InMemoryBackend
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def init_cache() -> Generator[Any, Any, None]:
|
def _init_cache() -> Generator[Any, Any, None]: # pyright: ignore[reportUnusedFunction]
|
||||||
FastAPICache.init(InMemoryBackend())
|
FastAPICache.init(InMemoryBackend())
|
||||||
yield
|
yield
|
||||||
FastAPICache.reset()
|
FastAPICache.reset()
|
||||||
|
|||||||
Reference in New Issue
Block a user