Skip to content

Commit f2d7616

Browse files
committed
Fix ruff issues
1 parent fb682b7 commit f2d7616

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ ignore = [
110110
"S101", # "Use of `assert` detected"
111111
"SIM108", # "Use ternary operator ...". Ternary is harmful for readability in some cases.
112112
"TRY003", # "Avoid specifying long messages outside the exception class"
113+
"FA100", # "Missing `from __future__ import annotations` ..." pytest-split supports a range of Python versions
113114
]
114115
line-length = 88
115116
target-version = "py37"

tests/test_algorithms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from pytest_split.algorithms import Algorithms
1313

14-
item = namedtuple("item", "nodeid")
14+
item = namedtuple("item", "nodeid") # noqa: PYI024
1515

1616

1717
class TestAlgorithms:

tests/test_ipynb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pytest_split.algorithms import Algorithms
55
from pytest_split.ipynb_compatibility import ensure_ipynb_compatibility
66

7-
item = namedtuple("item", "nodeid")
7+
item = namedtuple("item", "nodeid") # noqa: PYI024
88

99

1010
class TestIPyNb:

tests/test_plugin.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import itertools
22
import json
33
import os
4+
from typing import ClassVar
45

56
import pytest
67
from _pytest.main import ExitCode
@@ -90,7 +91,7 @@ def test_it_removes_old_when_cli_flag_used(self, example_suite, durations_path):
9091
durations = json.load(f)
9192

9293
for item in old_durations:
93-
assert item not in durations.keys()
94+
assert item not in durations
9495
assert len(durations) == EXAMPLE_SUITE_TEST_COUNT
9596

9697
def test_it_does_not_store_without_flag(self, example_suite, durations_path):
@@ -99,7 +100,7 @@ def test_it_does_not_store_without_flag(self, example_suite, durations_path):
99100

100101

101102
class TestSplitToSuites:
102-
parameters = [
103+
parameters: ClassVar = [
103104
(
104105
1,
105106
1,
@@ -163,12 +164,12 @@ class TestSplitToSuites:
163164
(4, 3, "least_duration", ["test_2", "test_5", "test_7"]),
164165
(4, 4, "least_duration", ["test_3", "test_8"]),
165166
]
166-
legacy_duration = [True, False]
167-
all_params = [
167+
legacy_duration: ClassVar = [True, False]
168+
all_params: ClassVar = [
168169
(*param, legacy_flag)
169170
for param, legacy_flag in itertools.product(parameters, legacy_duration)
170171
]
171-
enumerated_params = [(i, *param) for i, param in enumerate(all_params)]
172+
enumerated_params: ClassVar = [(i, *param) for i, param in enumerate(all_params)]
172173

173174
@pytest.mark.parametrize(
174175
("test_idx", "splits", "group", "algo", "expected", "legacy_flag"),

0 commit comments

Comments
 (0)