Skip to content

Commit

Permalink
Fixed types.
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Kirilin <[email protected]>
  • Loading branch information
s3rius committed Dec 6, 2023
1 parent 8240273 commit ef004ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Install deps
run: poetry install
- name: Run pytest check
run: poetry run pytest -vv --cov="aiohttp_deps" .
run: poetry run pytest -vv -n auto --cov="aiohttp_deps" .
- name: Generate report
run: poetry run coverage xml
- name: Upload coverage reports to Codecov with GitHub Action
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ Sometimes for tests you don't want to calculate actual functions
and you want to pass another functions instead.

To do so, you can add "dependency_overrides" or "values_overrides" to the aplication's state.
These values should be dicts.
These values should be dicts. The keys for these values can be found in `aiohttp_deps.keys` module.

Here's an example.

Expand Down
7 changes: 5 additions & 2 deletions tests/test_swagger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections import deque
from typing import Any, Dict, Generic, Optional, TypeVar
from typing import Any, Dict, Generic, Optional, TypeVar, Union

import pytest
from aiohttp import web
Expand Down Expand Up @@ -36,7 +36,10 @@ def follow_ref(ref: str, data: Dict[str, Any]) -> Dict[str, Any]:
return current_model


def get_schema_by_ref(full_schema: Dict[str, Any], ref: str) -> Dict[str, Any] | Any:
def get_schema_by_ref(
full_schema: Dict[str, Any],
ref: str,
) -> Union[Dict[str, Any], Any]:
ref_path = deque(ref.split("/"))
current_schema = full_schema
while ref_path:
Expand Down

0 comments on commit ef004ad

Please sign in to comment.