Skip to content

TST: Add @td.skip_if_no_scipy to failing test #45731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pandas/tests/series/methods/test_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
isna,
)
import pandas._testing as tm
from pandas.util.version import Version


@pytest.fixture(
Expand Down Expand Up @@ -778,6 +779,7 @@ def test_interp_non_timedelta_index(self, interp_methods_ind, ind):
with pytest.raises(ValueError, match=expected_error):
df[0].interpolate(method=method, **kwargs)

@td.skip_if_no_scipy
def test_interpolate_timedelta_index(self, request, interp_methods_ind):
"""
Tests for non numerical index types - object, period, timedelta
Expand All @@ -789,10 +791,11 @@ def test_interpolate_timedelta_index(self, request, interp_methods_ind):
df = pd.DataFrame([0, 1, np.nan, 3], index=ind)

method, kwargs = interp_methods_ind
if method == "pchip":
pytest.importorskip("scipy")
import scipy

if method in {"cubic", "zero"}:
if method in {"cubic", "zero"} or (
method == "barycentric" and Version(scipy.__version__) < Version("1.5.0")
):
request.node.add_marker(
pytest.mark.xfail(
reason=f"{method} interpolation is not supported for TimedeltaIndex"
Expand Down