@@ -122,10 +122,13 @@ def test_error(self, data, all_arithmetic_operators):
122
122
with pytest .raises (AttributeError ):
123
123
getattr (data , op_name )
124
124
125
- def test_direct_arith_with_series_returns_not_implemented (self , data ):
126
- # EAs should return NotImplemented for ops with Series.
125
+ @pytest .mark .parametrize ("box" , [pd .Series , pd .DataFrame ])
126
+ def test_direct_arith_with_ndframe_returns_not_implemented (self , data , box ):
127
+ # EAs should return NotImplemented for ops with Series/DataFrame
127
128
# Pandas takes care of unboxing the series and calling the EA's op.
128
129
other = pd .Series (data )
130
+ if box is pd .DataFrame :
131
+ other = other .to_frame ()
129
132
if hasattr (data , "__add__" ):
130
133
result = data .__add__ (other )
131
134
assert result is NotImplemented
@@ -164,10 +167,14 @@ def test_compare_array(self, data, all_compare_operators):
164
167
other = pd .Series ([data [0 ]] * len (data ))
165
168
self ._compare_other (s , data , op_name , other )
166
169
167
- def test_direct_arith_with_series_returns_not_implemented (self , data ):
168
- # EAs should return NotImplemented for ops with Series.
170
+ @pytest .mark .parametrize ("box" , [pd .Series , pd .DataFrame ])
171
+ def test_direct_arith_with_ndframe_returns_not_implemented (self , data , box ):
172
+ # EAs should return NotImplemented for ops with Series/DataFrame
169
173
# Pandas takes care of unboxing the series and calling the EA's op.
170
174
other = pd .Series (data )
175
+ if box is pd .DataFrame :
176
+ other = other .to_frame ()
177
+
171
178
if hasattr (data , "__eq__" ):
172
179
result = data .__eq__ (other )
173
180
assert result is NotImplemented
0 commit comments