Skip to content

Commit 3d99061

Browse files
even-evenvyuroshchin
andauthored
Add tests for Python 3.14 (#404)
Co-authored-by: vyuroshchin <vyuroshchin@sberautotech.ru>
1 parent b11b7d4 commit 3d99061

8 files changed

Lines changed: 22 additions & 15 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: [macos-latest, ubuntu-latest, windows-latest]
19-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
19+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
2020

2121
steps:
2222
- name: Checkout code

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
# Ruff version.
4-
rev: v0.13.0
4+
rev: v0.14.1
55
hooks:
66
# Run the linter.
77
- id: ruff-check

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Drop support for Python 3.8 (Jendrik Seipp, #398).
44
* Handle `while True` loops without `break` statements (kreathon).
55
* Add whitelist for `ssl.SSLContext` (tunnelsociety, #392).
6+
* Add support for Python 3.14 (even-even).
67

78
# 2.14 (2024-12-08)
89

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ classifiers = [
2525
"Programming Language :: Python :: 3.11",
2626
"Programming Language :: Python :: 3.12",
2727
"Programming Language :: Python :: 3.13",
28+
"Programming Language :: Python :: 3.14",
2829
"Programming Language :: Python :: Implementation :: CPython",
2930
"Programming Language :: Python :: Implementation :: PyPy",
3031
"Topic :: Software Development :: Quality Assurance",

tests/test_size.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import ast
2+
import sys
3+
4+
import pytest
25

36
from vulture import lines
47

@@ -118,6 +121,9 @@ class Foo:
118121
check_size(example, 9)
119122

120123

124+
@pytest.mark.skipif(
125+
sys.version_info >= (3, 14), reason="https://peps.python.org/pep-0765/"
126+
)
121127
def test_size_try_finally():
122128
example = """
123129
class Foo:

tests/test_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ def bar():
133133
@pytest.mark.parametrize(
134134
"decorated",
135135
[
136-
("def foo():"),
137-
("async def foo():"),
138-
("class Foo:"),
136+
"def foo():",
137+
"async def foo():",
138+
"class Foo:",
139139
],
140140
)
141141
def test_get_decorator_name_multiple_callables(decorated):

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = cleanup, py{310,311,312,313} # Skip py39 since it chokes on distutils.
2+
envlist = cleanup, py{310,311,312,313,314} # Skip py39 since it chokes on distutils.
33
skip_missing_interpreters = true
44

55
# Erase old coverage results, then accumulate them during this tox run.

vulture/core.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,16 @@ def get_whitelist_string(self):
166166
filename = utils.format_path(self.filename)
167167
if self.typ == "unreachable_code":
168168
return f"# {self.message} ({filename}:{self.first_lineno})"
169-
else:
170-
prefix = ""
171-
if self.typ in ["attribute", "method", "property"]:
172-
prefix = "_."
173-
return (
174-
f"{prefix}{self.name} # unused {self.typ} "
175-
f"({filename}:{self.first_lineno:d})"
176-
)
169+
prefix = ""
170+
if self.typ in ["attribute", "method", "property"]:
171+
prefix = "_."
172+
return (
173+
f"{prefix}{self.name} # unused {self.typ} "
174+
f"({filename}:{self.first_lineno:d})"
175+
)
177176

178177
def _tuple(self):
179-
return (self.filename, self.first_lineno, self.name)
178+
return self.filename, self.first_lineno, self.name
180179

181180
def __repr__(self):
182181
return repr(self.name)

0 commit comments

Comments
 (0)