diff --git a/django_migrations_ci/pytest_plugin.py b/django_migrations_ci/pytest_plugin.py index 441467e..8f79840 100644 --- a/django_migrations_ci/pytest_plugin.py +++ b/django_migrations_ci/pytest_plugin.py @@ -33,7 +33,7 @@ def pytest_configure(config): return try: - from pytest_django import plugin # type: ignore[import-untyped] + from pytest_django import plugin db_unblock = config.stash[plugin.blocking_manager_key].unblock except AttributeError: diff --git a/pyproject.toml b/pyproject.toml index 7dc2d4a..297f802 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,12 @@ skip_covered = true exclude = [ "example/", ] +plugins = [ + "mypy_django_plugin.main", +] +[tool.django-stubs] +django_settings_module = "tests.testapp.settings" + [tool.ruff.lint] select = ["ALL"] diff --git a/tests/testapp/models.py b/tests/testapp/models.py index bfa9ac8..283088d 100644 --- a/tests/testapp/models.py +++ b/tests/testapp/models.py @@ -2,4 +2,4 @@ class Bus(models.Model): - plate = models.TextField() # type: ignore[var-annotated] + plate = models.TextField() diff --git a/tox.ini b/tox.ini index 03c2b41..b8d371c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] isolated_build = true -envlist = py{310,311}-dj{32,42,50,latest}-{mysql,postgresql,sqlite},lint,py312-dj{50,latest} +envlist = py{310,311}-dj{32,42,50,latest}-{mysql,postgresql,sqlite},lint,mypy,py312-dj{50,latest} [testenv] allowlist_externals = poetry @@ -29,6 +29,9 @@ commands = description = lint source code deps = mypy + django-stubs + pytest + pytest-django commands = mypy .