diff --git a/pandas/_testing/_warnings.py b/pandas/_testing/_warnings.py index 6ed8a7b9154d4..d2d1f5c0c273e 100644 --- a/pandas/_testing/_warnings.py +++ b/pandas/_testing/_warnings.py @@ -110,7 +110,9 @@ class for all warnings. To raise multiple types of exceptions, if isinstance(match, tuple) else (match,) * len(expected_warning) ) - for warning_type, warning_match in zip(expected_warning, match): + for warning_type, warning_match in zip( + expected_warning, match, strict=True + ): _assert_caught_expected_warnings( caught_warnings=w, expected_warning=warning_type, diff --git a/pandas/_testing/asserters.py b/pandas/_testing/asserters.py index c8f3bb6bd77d2..fc2cae5fadaa7 100644 --- a/pandas/_testing/asserters.py +++ b/pandas/_testing/asserters.py @@ -675,7 +675,7 @@ def _raise(left, right, err_msg) -> NoReturn: ) diff = 0 - for left_arr, right_arr in zip(left, right): + for left_arr, right_arr in zip(left, right, strict=True): # count up differences if not array_equivalent(left_arr, right_arr, strict_nan=strict_nan): diff += 1 @@ -1447,7 +1447,7 @@ def assert_copy(iter1, iter2, **eql_kwargs) -> None: the same object. (Does not check that items in sequences are also not the same object) """ - for elem1, elem2 in zip(iter1, iter2): + for elem1, elem2 in zip(iter1, iter2, strict=True): assert_almost_equal(elem1, elem2, **eql_kwargs) msg = ( f"Expected object {type(elem1)!r} and object {type(elem2)!r} to be "