[pylint] Fixes all `use-maxplit-args, consider-using-enumerate` (#12172)

* [pylint 'use-maxsplit-arg'] Do not split more than necessary when using the first element

* [pylint 'consider-using-enumerate'] Use zip when iterating on two iterators

* [pylint] 'cell-var-from-loop' and 'disallowed-name' permanent disable

* [pylint] Disable 'possibly-used-before-assignment' following 3.2.0 release
This commit is contained in:
Pierre Sassoulas
2024-05-27 21:18:03 +02:00
committed by GitHub
parent 24abe4eb03
commit 88fae23bdd
4 changed files with 18 additions and 16 deletions

View File

@@ -280,10 +280,8 @@ def test_warning_recorded_hook(pytester: Pytester) -> None:
("call warning", "runtest", "test_warning_recorded_hook.py::test_func"),
("teardown warning", "runtest", "test_warning_recorded_hook.py::test_func"),
]
for index in range(len(expected)):
collected_result = collected[index]
expected_result = expected[index]
assert len(collected) == len(expected) # python < 3.10 zip(strict=True)
for collected_result, expected_result in zip(collected, expected):
assert collected_result[0] == expected_result[0], str(collected)
assert collected_result[1] == expected_result[1], str(collected)
assert collected_result[2] == expected_result[2], str(collected)