File tree Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Original file line number Diff line number Diff line change 1
- from distutils .version import LooseVersion
2
-
3
1
import numpy as np
4
2
import pytest
5
3
9
7
from pandas import DataFrame , Series
10
8
import pandas ._testing as tm
11
9
12
- try :
13
- import xarray
14
-
15
- _XARRAY_INSTALLED = True
16
- except ImportError :
17
- _XARRAY_INSTALLED = False
18
-
19
10
20
11
class TestDataFrameToXArray :
21
- @pytest .mark .skipif (
22
- not _XARRAY_INSTALLED
23
- or _XARRAY_INSTALLED
24
- and LooseVersion (xarray .__version__ ) < LooseVersion ("0.10.0" ),
25
- reason = "xarray >= 0.10.0 required" ,
26
- )
12
+ @td .skip_if_no ("xarray" , "0.10.0" )
27
13
def test_to_xarray_index_types (self , indices ):
28
14
if isinstance (indices , pd .MultiIndex ):
29
15
pytest .skip ("MultiIndex is tested separately" )
@@ -106,12 +92,7 @@ def test_to_xarray(self):
106
92
107
93
108
94
class TestSeriesToXArray :
109
- @pytest .mark .skipif (
110
- not _XARRAY_INSTALLED
111
- or _XARRAY_INSTALLED
112
- and LooseVersion (xarray .__version__ ) < LooseVersion ("0.10.0" ),
113
- reason = "xarray >= 0.10.0 required" ,
114
- )
95
+ @td .skip_if_no ("xarray" , "0.10.0" )
115
96
def test_to_xarray_index_types (self , indices ):
116
97
if isinstance (indices , pd .MultiIndex ):
117
98
pytest .skip ("MultiIndex is tested separately" )
You can’t perform that action at this time.
0 commit comments