Skip to content

Commit 0425bb0

Browse files
committed
Add test cases for unused and loop variable validations
1 parent b568909 commit 0425bb0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/test_plugin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,16 @@ def test_naming_validations(input_source: str, expected_output: list[str]) -> No
197197
),
198198
# No violation: Variable used multiple times
199199
("def fetch_item(values: list[int]) -> int:\n return values[0]", []),
200+
# No violation: Variable not used
201+
("def fetch_item(values: list[int]) -> int:\n ...", []),
200202
# No violation: Variable used in conditional
201203
(
202204
"def fetch_item(values: list[int]) -> int | None:\n if len(values) > 0:\n return values[0]\n "
203205
"return None",
204206
[],
205207
),
208+
# No violation: Variable used in loop
209+
("def fetch_item():\n for _, one_value in values: print(f'{one_value}')", []),
206210
],
207211
)
208212
def test_variable_usage_validations(input_source: str, expected_output: list[str]) -> None:

0 commit comments

Comments
 (0)