From 23e5f861626fd8af29420718bbc5368f405f61df Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 5 Mar 2026 12:20:03 +0000 Subject: [PATCH] mypy: Start checking tests We were only passing testtools to mypy, which meant tests were never getting run through mypy. Fixing this highlights a large number of issues that must be resolved. Signed-off-by: Stephen Finucane --- .github/workflows/test.yml | 6 +++--- pyproject.toml | 4 ++++ tox.ini | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b19aa548..2ddeb922 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,12 +32,12 @@ jobs: - name: Ruff run: | - python -m ruff check . - python -m ruff format --check . + python -m ruff check + python -m ruff format --check - name: Type Check run: | - python -m mypy testtools + python -m mypy test: runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index 68e9ea15..27385f02 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,6 +69,10 @@ warn_unused_ignores = false # FIXME(stephenfin): We should remove this implicit_reexport = true exclude = 'doc' +files = [ + "testtools", + "tests", +] [[tool.mypy.overrides]] module = [ diff --git a/tox.ini b/tox.ini index 6cf33bac..7af1deb1 100644 --- a/tox.ini +++ b/tox.ini @@ -14,11 +14,11 @@ commands = deps = ruff commands = - ruff check --fix . - ruff format . + ruff check --fix + ruff format [testenv:mypy] deps = mypy commands = - mypy --cache-dir="{envdir}/mypy_cache" {posargs:testtools} + mypy --cache-dir="{envdir}/mypy_cache" {posargs}