Skip to content

CLN: xarray tests #32943

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 4 commits into from
Mar 24, 2020
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
23 changes: 2 additions & 21 deletions pandas/tests/generic/test_to_xarray.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from distutils.version import LooseVersion

import numpy as np
import pytest

Expand All @@ -9,21 +7,9 @@
from pandas import DataFrame, Series
import pandas._testing as tm

try:
import xarray

_XARRAY_INSTALLED = True
except ImportError:
_XARRAY_INSTALLED = False


class TestDataFrameToXArray:
@pytest.mark.skipif(
not _XARRAY_INSTALLED
or _XARRAY_INSTALLED
and LooseVersion(xarray.__version__) < LooseVersion("0.10.0"),
reason="xarray >= 0.10.0 required",
)
@td.skip_if_no("xarray", "0.10.0")
def test_to_xarray_index_types(self, indices):
if isinstance(indices, pd.MultiIndex):
pytest.skip("MultiIndex is tested separately")
Expand Down Expand Up @@ -106,12 +92,7 @@ def test_to_xarray(self):


class TestSeriesToXArray:
@pytest.mark.skipif(
not _XARRAY_INSTALLED
or _XARRAY_INSTALLED
and LooseVersion(xarray.__version__) < LooseVersion("0.10.0"),
reason="xarray >= 0.10.0 required",
)
@td.skip_if_no("xarray", "0.10.0")
def test_to_xarray_index_types(self, indices):
if isinstance(indices, pd.MultiIndex):
pytest.skip("MultiIndex is tested separately")
Expand Down