Skip to content

Commit

Permalink
fix some ruff issues
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Ramsay <[email protected]>
  • Loading branch information
seapagan committed Mar 21, 2024
1 parent 53161ac commit 10a35f5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Literal

import pytest

from fastapi_redis_cache import FastApiRedisCache


Expand Down
6 changes: 4 additions & 2 deletions tests/live_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

import logging
import os
from collections.abc import AsyncGenerator
from contextlib import asynccontextmanager
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal
from typing import Union
from typing import Any, Union

from fastapi import FastAPI, Request, Response

Expand All @@ -24,7 +25,8 @@


@asynccontextmanager
async def lifespan(app: FastAPI):
async def lifespan(app: FastAPI) -> AsyncGenerator[Any, None]:
"""Configure the cache and yield the app."""
redis_cache = FastApiRedisCache()
redis_cache.init(
host_url=os.environ.get("REDIS_URL", REDIS_SERVER_URL),
Expand Down
1 change: 1 addition & 0 deletions tests/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import Union

from fastapi import FastAPI, Request, Response

from fastapi_redis_cache import cache, cache_one_hour, cache_one_minute

app = FastAPI(title="FastAPI Redis Cache Test App")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import pytest
from fastapi import status
from fastapi.testclient import TestClient

from fastapi_redis_cache.client import HTTP_TIME
from fastapi_redis_cache.util import ONE_HOUR_IN_SECONDS, deserialize_json

from tests.main import app

client = TestClient(app)
Expand Down

0 comments on commit 10a35f5

Please sign in to comment.