12
12
from pandas import (
13
13
DataFrame , Index , MultiIndex , Series , Timestamp , date_range , isna )
14
14
import pandas .core .nanops as nanops
15
- from pandas .util import testing as tm
15
+ from pandas .util import _test_decorators as td , testing as tm
16
16
17
17
18
18
@pytest .mark .parametrize ("agg_func" , ['any' , 'all' ])
@@ -461,11 +461,8 @@ def test_groupby_cumprod():
461
461
462
462
463
463
def scipy_sem (* args , ** kwargs ):
464
- try :
465
- from scipy .stats import sem
466
- return sem (* args , ddof = 1 , ** kwargs )
467
- except ImportError :
468
- pytest .skip ("No Scipy installed" )
464
+ from scipy .stats import sem
465
+ return sem (* args , ddof = 1 , ** kwargs )
469
466
470
467
471
468
@pytest .mark .parametrize (
@@ -481,7 +478,7 @@ def scipy_sem(*args, **kwargs):
481
478
('first' , lambda x : x .iloc [0 ]),
482
479
('last' , lambda x : x .iloc [- 1 ]),
483
480
('count' , np .size ),
484
- ('sem' , scipy_sem )])
481
+ pytest . param ('sem' , scipy_sem , mark = td . _skip_if_no_scipy )])
485
482
def test_ops_general (op , targop ):
486
483
df = DataFrame (np .random .randn (1000 ))
487
484
labels = np .random .randint (0 , 50 , size = 1000 ).astype (float )
0 commit comments