diff --git a/pandas/tests/window/test_cython_aggregations.py b/pandas/tests/window/test_cython_aggregations.py index 39811ea3ec5b9..2e23618a3a201 100644 --- a/pandas/tests/window/test_cython_aggregations.py +++ b/pandas/tests/window/test_cython_aggregations.py @@ -62,7 +62,7 @@ def _get_rolling_aggregations(): ] ) # unzip to a list of 2 tuples, names and functions - unzipped = list(zip(*named_roll_aggs)) + unzipped = list(zip(*named_roll_aggs, strict=True)) return {"ids": unzipped[0], "params": unzipped[1]} diff --git a/pandas/tests/window/test_expanding.py b/pandas/tests/window/test_expanding.py index 2c96ce01c6328..ddcdf07beeb4c 100644 --- a/pandas/tests/window/test_expanding.py +++ b/pandas/tests/window/test_expanding.py @@ -180,7 +180,7 @@ def test_iter_expanding_dataframe(df, expected, min_periods): df = DataFrame(df) expecteds = [DataFrame(values, index=index) for (values, index) in expected] - for expected, actual in zip(expecteds, df.expanding(min_periods)): + for expected, actual in zip(expecteds, df.expanding(min_periods), strict=False): tm.assert_frame_equal(actual, expected) @@ -199,7 +199,7 @@ def test_iter_expanding_series(ser, expected, min_periods): # GH 11704 expecteds = [Series(values, index=index) for (values, index) in expected] - for expected, actual in zip(expecteds, ser.expanding(min_periods)): + for expected, actual in zip(expecteds, ser.expanding(min_periods), strict=True): tm.assert_series_equal(actual, expected) diff --git a/pandas/tests/window/test_rolling.py b/pandas/tests/window/test_rolling.py index 18aafa0d7b71e..3003b142edd3b 100644 --- a/pandas/tests/window/test_rolling.py +++ b/pandas/tests/window/test_rolling.py @@ -764,7 +764,9 @@ def test_iter_rolling_dataframe(df, expected, window, min_periods): df = DataFrame(df) expecteds = [DataFrame(values, index=index) for (values, index) in expected] - for expected, actual in zip(expecteds, df.rolling(window, min_periods=min_periods)): + for expected, actual in zip( + expecteds, df.rolling(window, min_periods=min_periods), strict=False + ): tm.assert_frame_equal(actual, expected) @@ -810,7 +812,7 @@ def test_iter_rolling_on_dataframe(expected, window): expecteds = [ DataFrame(values, index=df.loc[index, "C"]) for (values, index) in expected ] - for expected, actual in zip(expecteds, df.rolling(window, on="C")): + for expected, actual in zip(expecteds, df.rolling(window, on="C"), strict=False): tm.assert_frame_equal(actual, expected) @@ -819,7 +821,7 @@ def test_iter_rolling_on_dataframe_unordered(): df = DataFrame({"a": ["x", "y", "x"], "b": [0, 1, 2]}) results = list(df.groupby("a").rolling(2)) expecteds = [df.iloc[idx, [1]] for idx in [[0], [0, 2], [1]]] - for result, expected in zip(results, expecteds): + for result, expected in zip(results, expecteds, strict=True): tm.assert_frame_equal(result, expected) @@ -861,7 +863,7 @@ def test_iter_rolling_series(ser, expected, window, min_periods): expecteds = [Series(values, index=index) for (values, index) in expected] for expected, actual in zip( - expecteds, ser.rolling(window, min_periods=min_periods) + expecteds, ser.rolling(window, min_periods=min_periods), strict=True ): tm.assert_series_equal(actual, expected) @@ -909,10 +911,11 @@ def test_iter_rolling_datetime(expected, expected_index, window): ser = Series(range(5), index=date_range(start="2020-01-01", periods=5, freq="D")) expecteds = [ - Series(values, index=idx) for (values, idx) in zip(expected, expected_index) + Series(values, index=idx) + for (values, idx) in zip(expected, expected_index, strict=True) ] - for expected, actual in zip(expecteds, ser.rolling(window)): + for expected, actual in zip(expecteds, ser.rolling(window), strict=True): tm.assert_series_equal(actual, expected) diff --git a/pyproject.toml b/pyproject.toml index 094d0b44a6721..49bb49aab03c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -591,9 +591,6 @@ exclude = [ "pandas/tests/tseries/offsets/test_month.py" = ["B905"] "pandas/tests/tseries/offsets/test_offsets.py" = ["B905"] "pandas/tests/util/test_validate_kwargs.py" = ["B905"] -"pandas/tests/window/test_cython_aggregations.py" = ["B905"] -"pandas/tests/window/test_expanding.py" = ["B905"] -"pandas/tests/window/test_rolling.py" = ["B905"] "scripts/validate_unwanted_patterns.py" = ["B905"] [tool.ruff.lint.flake8-pytest-style]