Skip to content

Commit a609b57

Browse files
authored
STY: Add strict=True to zip() calls in pandas/_testing (#62681)
1 parent 8d32d57 commit a609b57

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pandas/_testing/_warnings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ class for all warnings. To raise multiple types of exceptions,
110110
if isinstance(match, tuple)
111111
else (match,) * len(expected_warning)
112112
)
113-
for warning_type, warning_match in zip(expected_warning, match):
113+
for warning_type, warning_match in zip(
114+
expected_warning, match, strict=True
115+
):
114116
_assert_caught_expected_warnings(
115117
caught_warnings=w,
116118
expected_warning=warning_type,

pandas/_testing/asserters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ def _raise(left, right, err_msg) -> NoReturn:
675675
)
676676

677677
diff = 0
678-
for left_arr, right_arr in zip(left, right):
678+
for left_arr, right_arr in zip(left, right, strict=True):
679679
# count up differences
680680
if not array_equivalent(left_arr, right_arr, strict_nan=strict_nan):
681681
diff += 1
@@ -1447,7 +1447,7 @@ def assert_copy(iter1, iter2, **eql_kwargs) -> None:
14471447
the same object. (Does not check that items
14481448
in sequences are also not the same object)
14491449
"""
1450-
for elem1, elem2 in zip(iter1, iter2):
1450+
for elem1, elem2 in zip(iter1, iter2, strict=True):
14511451
assert_almost_equal(elem1, elem2, **eql_kwargs)
14521452
msg = (
14531453
f"Expected object {type(elem1)!r} and object {type(elem2)!r} to be "

0 commit comments

Comments
 (0)