Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: sfmig <[email protected]>
  • Loading branch information
lochhh and sfmig authored Jan 30, 2025
1 parent da6a2d5 commit e821159
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions tests/test_unit/test_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,20 @@ def test_filter_with_nans_on_position(
)

@pytest.mark.parametrize(
"override_kwargs",
"override_kwargs, expected_exception",
[
{"mode": "nearest"},
{"axis": 1},
{"mode": "nearest", "axis": 1},
({"mode": "nearest"}, does_not_raise()),
({"axis": 1}, pytest.raises(ValueError)),
({"mode": "nearest", "axis": 1}, pytest.raises(ValueError)),
],
)
def test_savgol_filter_kwargs_override(
self, valid_dataset, override_kwargs, request
self, valid_dataset, override_kwargs, expected_exception, request
):
"""Test that overriding keyword arguments in the
Savitzky-Golay filter works, except for the ``axis`` argument,
which should raise a ValueError.
"""
expected_exception = (
pytest.raises(ValueError)
if "axis" in override_kwargs
else does_not_raise()
)
with expected_exception:
savgol_filter(
request.getfixturevalue(valid_dataset).position,
Expand Down Expand Up @@ -158,7 +153,7 @@ def test_interpolate_over_time_on_position(

@pytest.mark.parametrize(
"window",
[3, 5, 6, 10], # data is nframes = 10
[3, 5, 6, 10], # input data has 10 frames
)
@pytest.mark.parametrize("filter_func", [median_filter, savgol_filter])
def test_filter_with_nans_on_position_varying_window(
Expand Down

0 comments on commit e821159

Please sign in to comment.