Skip to content

Commit

Permalink
new: typecheck more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Sep 11, 2024
1 parent 680004b commit 42d25e1
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 59 deletions.
10 changes: 8 additions & 2 deletions .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ ignore_errors = True
[mypy-valkey._cache]
ignore_errors = True


[mypy-tests.*]
ignore_errors = True

[mypy-tests.test_commands]
ignore_errors = False
[mypy-tests.test_asyncio.test_commands]
ignore_errors = False
[mypy-tests.test_pipeline]
ignore_errors = False
[mypy-tests.test_asyncio.test_pipeline]
ignore_errors = False
[mypy-tests.test_pubsub]
ignore_errors = False
[mypy-tests.test_asyncio.test_pubsub]
ignore_errors = False

[mypy-benchmarks.*]
ignore_errors = True
Expand Down
2 changes: 2 additions & 0 deletions tests/test_asyncio/compat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import asyncio
from unittest import mock

__all__ = ["mock", "aclosing", "create_task"]

try:
mock.AsyncMock
except AttributeError:
Expand Down
4 changes: 3 additions & 1 deletion tests/test_asyncio/test_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest
import valkey
from tests.conftest import skip_if_server_version_lt
Expand Down Expand Up @@ -308,7 +310,7 @@ async def test_aclosing(self, r):
async def test_transaction_callable(self, r):
await r.set("a", 1)
await r.set("b", 2)
has_run = []
has_run: list[str] = []

async def my_transaction(pipe):
a_value = await pipe.get("a")
Expand Down
Loading

0 comments on commit 42d25e1

Please sign in to comment.