@@ -1625,24 +1625,33 @@ def eval(self, *args, **kwargs):
16251625 def test_unary_functions (self ):
16261626 df = DataFrame ({'a' : np .random .randn (10 )})
16271627 a = df .a
1628- for fn in self .unary_fns :
1628+ unary_functions = [x for x in self .unary_fns
1629+ if x not in ('floor' , 'ceil' )]
1630+ for fn in unary_functions :
16291631 expr = "{0}(a)" .format (fn )
1632+ got = self .eval (expr )
16301633 with np .errstate (all = 'ignore' ):
1631- if hasattr (np , fn ):
1632- got = self .eval (expr )
1633- expect = getattr (np , fn )(a )
1634- tm .assert_series_equal (got , expect , check_names = False )
1634+ expect = getattr (np , fn )(a )
1635+ tm .assert_series_equal (got , expect , check_names = False )
1636+
1637+ @tm .skip_if_ne_ge_2_6_9
1638+ def test_floor_and_ceil_functions_in_ne_lt_2_6_9 (self ):
1639+ for fn in ('floor' , 'ceil' ):
1640+ msg = "\" {0}\" is not a supported function" .format (fn )
1641+ with pytest .raises (ValueError , match = msg ):
1642+ expr = "{0}(100)" .format (fn )
1643+ self .eval (expr )
16351644
1636- def test_all_unary_functions_not_supported_in_numpy_112 (self ):
1645+ @tm .skip_if_ne_lt_2_6_9
1646+ def test_floor_and_ceil_functions_in_ne_ge_2_6_9 (self ):
16371647 df = DataFrame ({'a' : np .random .randn (10 )})
16381648 a = df .a
1639- for fn in self . unary_fns :
1649+ for fn in ( 'floor' , 'ceil' ) :
16401650 expr = "{0}(a)" .format (fn )
1651+ got = self .eval (expr )
16411652 with np .errstate (all = 'ignore' ):
1642- if not hasattr (np , fn ):
1643- msg = '"{0}" is not a supported function' .format (fn )
1644- with pytest .raises (ValueError , match = msg ):
1645- self .eval (expr )
1653+ expect = getattr (np , fn )(a )
1654+ tm .assert_series_equal (got , expect , check_names = False )
16461655
16471656 def test_binary_functions (self ):
16481657 df = DataFrame ({'a' : np .random .randn (10 ),
0 commit comments