Skip to content

Commit

Permalink
mypy tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Dec 15, 2024
1 parent 7a8aca6 commit e94330b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ norecursedirs = "deprecated/*"
### mypy ############################################################################

[tool.mypy]
python_version = "3.12"

# strict = true
# enable_incomplete_feature = ["NewGenericSyntax"]

exclude = ["docs", "tests/tests_cc"]
files = ["cli", "src", "tests"]

Expand Down Expand Up @@ -109,12 +114,6 @@ warn_no_return = true
warn_unreachable = true


#
[[tool.mypy.overrides]]
module = ["tests.tests_rf.common"]

disable_error_code = ["type-arg"] # 21

#
[[tool.mypy.overrides]]
module = ["tests.tests_rf.faked_server.vendor"]
Expand Down
6 changes: 3 additions & 3 deletions tests/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@


type JsonValueType = (
dict[str, JsonValueType] | list[JsonValueType] | str | int | float | bool | None
dict[str, "JsonValueType"] | list["JsonValueType"] | str | int | float | bool | None
)
type JsonArrayType = list[JsonValueType]
type JsonObjectType = dict[str, JsonValueType]
type JsonArrayType = list["JsonValueType"]
type JsonObjectType = dict[str, "JsonValueType"]


class ClientStub:
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_rf/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ async def wait_for_comm_task_v2(auth: evo2.auth.Auth, task_id: str) -> bool:

assert rsp.content_type == "application/json", response

task: dict = response[0] if isinstance(response, list) else response
task: dict[str, str] = response[0] if isinstance(response, list) else response

if task["state"] == "Succeeded":
return True
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_rf/faked_server/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def readexactly(self, n: int) -> bytes:
"""Read exactly `n` bytes."""
raise NotImplementedError

async def readuntil(self, separator: _ReaduntilBuffer = b"\n") -> bytes: # type: ignore[override]
async def readuntil(self, separator: _ReaduntilBuffer = b"\n") -> bytes:
"""Read data from the stream until ``separator`` is found."""
raise NotImplementedError

Expand Down

0 comments on commit e94330b

Please sign in to comment.