@@ -606,11 +606,10 @@ def test_unary_in_array(self):
606
606
)
607
607
tm .assert_numpy_array_equal (result , expected )
608
608
609
- @pytest .mark .parametrize ("dtype" , [np .float32 , np .float64 ])
610
609
@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 ):
612
611
# GH 16363
613
- df = DataFrame ({"x" : np .array ([0 ], dtype = dtype )})
612
+ df = DataFrame ({"x" : np .array ([0 ], dtype = float_numpy_dtype )})
614
613
res = df .eval (expr )
615
614
assert res .values == np .array ([False ])
616
615
@@ -747,15 +746,16 @@ class TestTypeCasting:
747
746
@pytest .mark .parametrize ("op" , ["+" , "-" , "*" , "**" , "/" ])
748
747
# maybe someday... numexpr has too many upcasting rules now
749
748
# chain(*(np.core.sctypes[x] for x in ['uint', 'int', 'float']))
750
- @pytest .mark .parametrize ("dt" , [np .float32 , np .float64 ])
751
749
@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
+ )
754
754
left , right = left_right
755
755
s = f"{ left } { op } { right } "
756
756
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
759
759
tm .assert_frame_equal (res , eval (s ))
760
760
761
761
0 commit comments