Skip to content

Commit

Permalink
Revert attempted changes to call pytype directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoknjas committed Oct 4, 2024
1 parent 6e8735e commit 3074a3a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
15 changes: 15 additions & 0 deletions tests/test_pytype.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import subprocess
import sys
import pytest


@pytest.mark.skipif(
sys.version_info >= (3, 13), reason="Need python < 3.13 for pytype"
)
def test_pytype():
result = subprocess.run(
["pytype", "vulture/core.py", "--disable=attribute-error"],
capture_output=True,
text=True,
)
assert result.stdout.strip().endswith("Success: no errors found")
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ deps =
pint # Use latest version to catch API changes.
pytest
pytest-cov
py38,py310,py311,py312: pytype
pytype ; python_version < '3.13'
commands =
pytype vulture/core.py {posargs}
pytest {posargs}
# Install package as wheel in all envs (https://hynek.me/articles/turbo-charge-tox/).
package = wheel
Expand Down
3 changes: 1 addition & 2 deletions vulture/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def __init__(
message="",
confidence=DEFAULT_CONFIDENCE,
):
self.name: int = name
self.name: str = name
self.typ: str = typ
self.filename: Path = filename
self.first_lineno: int = first_lineno
Expand Down Expand Up @@ -220,7 +220,6 @@ def get_list(typ):
self.filename = Path()
self.code = []
self.exit_code = ExitCode.NoDeadCode
self.noqa_lines = {}

def scan(self, code, filename=""):
filename = Path(filename)
Expand Down

0 comments on commit 3074a3a

Please sign in to comment.