@@ -606,11 +606,10 @@ def test_unary_in_array(self):
606606 )
607607 tm .assert_numpy_array_equal (result , expected )
608608
609- @pytest .mark .parametrize ("dtype" , [np .float32 , np .float64 ])
610609 @pytest .mark .parametrize ("expr" , ["x < -0.1" , "-5 > x" ])
611- def test_float_comparison_bin_op (self , dtype , expr ):
610+ def test_float_comparison_bin_op (self , float_numpy_dtype , expr ):
612611 # GH 16363
613- df = DataFrame ({"x" : np .array ([0 ], dtype = dtype )})
612+ df = DataFrame ({"x" : np .array ([0 ], dtype = float_numpy_dtype )})
614613 res = df .eval (expr )
615614 assert res .values == np .array ([False ])
616615
@@ -747,15 +746,16 @@ class TestTypeCasting:
747746 @pytest .mark .parametrize ("op" , ["+" , "-" , "*" , "**" , "/" ])
748747 # maybe someday... numexpr has too many upcasting rules now
749748 # chain(*(np.core.sctypes[x] for x in ['uint', 'int', 'float']))
750- @pytest .mark .parametrize ("dt" , [np .float32 , np .float64 ])
751749 @pytest .mark .parametrize ("left_right" , [("df" , "3" ), ("3" , "df" )])
752- def test_binop_typecasting (self , engine , parser , op , dt , left_right ):
753- df = DataFrame (np .random .default_rng (2 ).standard_normal ((5 , 3 )), dtype = dt )
750+ def test_binop_typecasting (self , engine , parser , op , float_numpy_dtype , left_right ):
751+ df = DataFrame (
752+ np .random .default_rng (2 ).standard_normal ((5 , 3 )), dtype = float_numpy_dtype
753+ )
754754 left , right = left_right
755755 s = f"{ left } { op } { right } "
756756 res = pd .eval (s , engine = engine , parser = parser )
757- assert df .values .dtype == dt
758- assert res .values .dtype == dt
757+ assert df .values .dtype == float_numpy_dtype
758+ assert res .values .dtype == float_numpy_dtype
759759 tm .assert_frame_equal (res , eval (s ))
760760
761761
0 commit comments