Skip to content

Commit

Permalink
Run mypy on tests (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson committed Sep 16, 2024
1 parent c0099b9 commit ee85864
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
rev: 'v1.11.2'
hooks:
- id: mypy
exclude: "examples|tests|venv|ci|docs|conftest.py"
exclude: "examples|venv|ci|docs|conftest.py"
additional_dependencies: [types-pyyaml>=6.0]
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
Expand Down
12 changes: 6 additions & 6 deletions kr8s/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def test_api_factory(serviceaccount) -> None:
assert p.api is not k3


def test_api_factory_threaded() -> None:
def test_api_factory_threaded():
assert len(kr8s.Api._instances) == 0

q = queue.Queue()
Expand Down Expand Up @@ -96,13 +96,13 @@ async def test_api_factory_with_kubeconfig(k8s_cluster, serviceaccount) -> None:
assert p3.api is not k2


def test_version_sync() -> None:
def test_version_sync():
api = kr8s.api()
version = api.version()
assert "major" in version


async def test_version_sync_in_async() -> None:
async def test_version_sync_in_async():
api = kr8s.api()
version = api.version()
assert "major" in version
Expand All @@ -129,7 +129,7 @@ async def get_api():
tg.start_soon(get_api)


async def test_both_api_creation_methods_together() -> None:
async def test_both_api_creation_methods_together():
async_api = await kr8s.asyncio.api()
api = kr8s.api()

Expand Down Expand Up @@ -206,7 +206,7 @@ async def test_api_versions() -> None:
assert "apps/v1" in versions


def test_api_versions_sync() -> None:
def test_api_versions_sync():
api = kr8s.api()
versions = [version for version in api.api_versions()]
assert "apps/v1" in versions
Expand Down Expand Up @@ -253,7 +253,7 @@ def test_sync_get_returns_sync_objects() -> None:
assert pods[0]._asyncio is False


def test_sync_api_returns_sync_objects() -> None:
def test_sync_api_returns_sync_objects():
api = kr8s.api()
pods = api.get("pods", namespace=kr8s.ALL)
assert pods[0]._asyncio is False
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ convention = "google"
"ci/*" = ["D", "N", "B"]

[tool.mypy]
exclude = ["examples", "tests", "venv", "ci", "docs", "conftest.py"]
exclude = ["examples", "venv", "ci", "docs", "conftest.py"]

[tool.pyright]
exclude = ["examples", "**/tests", "venv", "ci", "docs", "conftest.py"]
Expand Down

0 comments on commit ee85864

Please # to comment.