[pylint 'consider-using-enumerate'] Use zip when iterating on two iterators
This commit is contained in:
parent
a194e5ed27
commit
9c0ec41983
|
@ -187,7 +187,6 @@ disable = [
|
|||
"comparison-with-itself",
|
||||
"condition-evals-to-constant",
|
||||
"consider-using-dict-items",
|
||||
"consider-using-enumerate",
|
||||
"consider-using-from-import",
|
||||
"consider-using-f-string",
|
||||
"consider-using-in",
|
||||
|
|
|
@ -100,14 +100,13 @@ class TestReportSerialization:
|
|||
|
||||
rep_entries = rep.longrepr.reprtraceback.reprentries
|
||||
a_entries = a.longrepr.reprtraceback.reprentries
|
||||
for i in range(len(a_entries)):
|
||||
rep_entry = rep_entries[i]
|
||||
assert len(rep_entries) == len(a_entries) # python < 3.10 zip(strict=True)
|
||||
for a_entry, rep_entry in zip(a_entries, rep_entries):
|
||||
assert isinstance(rep_entry, ReprEntry)
|
||||
assert rep_entry.reprfileloc is not None
|
||||
assert rep_entry.reprfuncargs is not None
|
||||
assert rep_entry.reprlocals is not None
|
||||
|
||||
a_entry = a_entries[i]
|
||||
assert isinstance(a_entry, ReprEntry)
|
||||
assert a_entry.reprfileloc is not None
|
||||
assert a_entry.reprfuncargs is not None
|
||||
|
@ -146,9 +145,10 @@ class TestReportSerialization:
|
|||
|
||||
rep_entries = rep.longrepr.reprtraceback.reprentries
|
||||
a_entries = a.longrepr.reprtraceback.reprentries
|
||||
for i in range(len(a_entries)):
|
||||
assert isinstance(rep_entries[i], ReprEntryNative)
|
||||
assert rep_entries[i].lines == a_entries[i].lines
|
||||
assert len(rep_entries) == len(a_entries) # python < 3.10 zip(strict=True)
|
||||
for rep_entry, a_entry in zip(rep_entries, a_entries):
|
||||
assert isinstance(rep_entry, ReprEntryNative)
|
||||
assert rep_entry.lines == a_entry.lines
|
||||
|
||||
def test_itemreport_outcomes(self, pytester: Pytester) -> None:
|
||||
# This test came originally from test_remote.py in xdist (ca03269).
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue