Skip to content

Commit

Permalink
Use 3.13 for sphinx install (#1059)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov authored Feb 20, 2025
1 parent 4e14245 commit b7982b4
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.13
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
Expand Down
4 changes: 3 additions & 1 deletion tests/test_abstract_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
from .typedefs import AiohttpClient


def make_cookie(client: TestClient[web.Request, web.Application], data: Dict[str, Any]) -> None:
def make_cookie(
client: TestClient[web.Request, web.Application], data: Dict[str, Any]
) -> None:
session_data = {"session": data, "created": int(time.time())}

value = json.dumps(session_data)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_cookie_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
from .typedefs import AiohttpClient


def make_cookie(client: TestClient[web.Request, web.Application], data: Dict[str, Any]) -> None:
def make_cookie(
client: TestClient[web.Request, web.Application], data: Dict[str, Any]
) -> None:
session_data = {"session": data, "created": int(time.time())}

value = json.dumps(session_data)
Expand Down
6 changes: 5 additions & 1 deletion tests/test_encrypted_cookie_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
MAX_AGE = 1


def make_cookie(client: TestClient[web.Request, web.Application], fernet: Fernet, data: Dict[str, Any]) -> None:
def make_cookie(
client: TestClient[web.Request, web.Application],
fernet: Fernet,
data: Dict[str, Any],
) -> None:
session_data = {"session": data, "created": int(time.time())}

cookie_data = json.dumps(session_data).encode("utf-8")
Expand Down
4 changes: 3 additions & 1 deletion tests/test_memcached_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def create_app(


async def make_cookie(
client: TestClient[web.Request, web.Application], memcached: aiomcache.Client, data: Dict[str, Any]
client: TestClient[web.Request, web.Application],
memcached: aiomcache.Client,
data: Dict[str, Any],
) -> None:
session_data = {"session": data, "created": int(time.time())}
value = json.dumps(session_data)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_nacl_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def test_invalid_key() -> None:


def make_cookie(
client: TestClient[web.Request, web.Application], secretbox: nacl.secret.SecretBox, data: Dict[str, Any]
client: TestClient[web.Request, web.Application],
secretbox: nacl.secret.SecretBox,
data: Dict[str, Any],
) -> None:
session_data = {"session": data, "created": int(time.time())}

Expand Down
12 changes: 9 additions & 3 deletions tests/test_redis_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def create_app(


async def make_cookie(
client: TestClient[web.Request, web.Application], redis: aioredis.Redis, data: dict[Any, Any]
client: TestClient[web.Request, web.Application],
redis: aioredis.Redis,
data: dict[Any, Any],
) -> None:
session_data = {"session": data, "created": int(time.time())}
value = json.dumps(session_data)
Expand All @@ -43,13 +45,17 @@ async def make_cookie(
client.session.cookie_jar.update_cookies({"AIOHTTP_SESSION": key})


async def make_cookie_with_bad_value(client: TestClient[web.Request, web.Application], redis: aioredis.Redis) -> None:
async def make_cookie_with_bad_value(
client: TestClient[web.Request, web.Application], redis: aioredis.Redis
) -> None:
key = uuid.uuid4().hex
await redis.set("AIOHTTP_SESSION_" + key, "")
client.session.cookie_jar.update_cookies({"AIOHTTP_SESSION": key})


async def load_cookie(client: TestClient[web.Request, web.Application], redis: aioredis.Redis) -> Any:
async def load_cookie(
client: TestClient[web.Request, web.Application], redis: aioredis.Redis
) -> Any:
cookies = client.session.cookie_jar.filter_cookies(client.make_url("/"))
key = cookies["AIOHTTP_SESSION"]
value_bytes = await redis.get("AIOHTTP_SESSION_" + key.value)
Expand Down
4 changes: 3 additions & 1 deletion tests/typedefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
from aiohttp import web
from aiohttp.test_utils import TestClient

AiohttpClient = Callable[[web.Application], Awaitable[TestClient[web.Request, web.Application]]]
AiohttpClient = Callable[
[web.Application], Awaitable[TestClient[web.Request, web.Application]]
]

0 comments on commit b7982b4

Please sign in to comment.