Skip to content

Commit

Permalink
Apply PR feedback (includes defining self.noqa_lines in the constru…
Browse files Browse the repository at this point in the history
…ctor and checking whether the pytype exit code is 0).
  • Loading branch information
johndoknjas committed Oct 4, 2024
1 parent 3074a3a commit 9415be7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_pytype.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import subprocess
import sys

import pytest


@pytest.mark.skipif(
sys.version_info >= (3, 13), reason="Need python < 3.13 for pytype"
sys.version_info >= (3, 13), reason="needs Python < 3.13 for pytype"
)
def test_pytype():
result = subprocess.run(
["pytype", "vulture/core.py", "--disable=attribute-error"],
["pytype", "vulture/core.py"],
capture_output=True,
text=True,
check=True,
)
assert result.stdout.strip().endswith("Success: no errors found")
1 change: 1 addition & 0 deletions vulture/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ 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 9415be7

Please sign in to comment.