From 2906201c8b8d10283fe5a333bb0a3ca8b3a9e5a4 Mon Sep 17 00:00:00 2001 From: johndoknjas Date: Wed, 2 Oct 2024 05:29:45 -0700 Subject: [PATCH] Replace mypy with pytype. --- tests/test_mypy.py | 21 --------------------- tests/test_pytype.py | 9 +++++++++ tox.ini | 2 +- 3 files changed, 10 insertions(+), 22 deletions(-) delete mode 100644 tests/test_mypy.py create mode 100644 tests/test_pytype.py diff --git a/tests/test_mypy.py b/tests/test_mypy.py deleted file mode 100644 index ee1d49f5..00000000 --- a/tests/test_mypy.py +++ /dev/null @@ -1,21 +0,0 @@ -import mypy.api - - -def test_mypy(): - result = mypy.api.run( - [ - "--check-untyped-defs", - "--ignore-missing-imports", - "--disable-error-code", - "truthy-function", - "--disable-error-code", - "no-redef", - "--disable-error-code", - "attr-defined", - "--disable-error-code", - "misc", - "./vulture", - ] - ) - assert result[0].startswith("Success: no issues found in ") - assert result[1:] == ("", 0) diff --git a/tests/test_pytype.py b/tests/test_pytype.py new file mode 100644 index 00000000..6c38b8f6 --- /dev/null +++ b/tests/test_pytype.py @@ -0,0 +1,9 @@ +import subprocess +from subprocess import PIPE + +def test_pytype(): + result = subprocess.run( + ['pytype', 'vulture/core.py', '--disable=attribute-error'], + stdout=PIPE, stderr=PIPE, universal_newlines=True + ) + assert result.stdout.strip().endswith('Success: no errors found') \ No newline at end of file diff --git a/tox.ini b/tox.ini index 04b1a2b1..ff16a568 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ deps = pint # Use latest version to catch API changes. pytest==7.4.2 pytest-cov==4.0.0 - mypy==1.11.0 + pytype==2024.9.13 commands = pytest {posargs} # Install package as wheel in all envs (https://hynek.me/articles/turbo-charge-tox/).