Skip to content

Commit dee6c8c

Browse files
committed
TST: Fix integer ops comparison test
The `op(Series[integer], other)` path was being tested twice. The `op(IntegerArray, other)` path was not being tested. Closes pandas-dev#22096
1 parent 8ed92ef commit dee6c8c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pandas/tests/arrays/test_integer.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,11 @@ def test_rpow_one_to_na(self):
314314

315315
class TestComparisonOps(BaseOpsUtil):
316316

317-
def _compare_other(self, s, data, op_name, other):
317+
def _compare_other(self, data, op_name, other):
318318
op = self.get_op_from_name(op_name)
319319

320320
# array
321-
result = op(s, other)
321+
result = pd.Series(op(data, other))
322322
expected = pd.Series(op(data._data, other))
323323

324324
# fill the nan locations
@@ -340,14 +340,12 @@ def _compare_other(self, s, data, op_name, other):
340340

341341
def test_compare_scalar(self, data, all_compare_operators):
342342
op_name = all_compare_operators
343-
s = pd.Series(data)
344-
self._compare_other(s, data, op_name, 0)
343+
self._compare_other(data, op_name, 0)
345344

346345
def test_compare_array(self, data, all_compare_operators):
347346
op_name = all_compare_operators
348-
s = pd.Series(data)
349347
other = pd.Series([0] * len(data))
350-
self._compare_other(s, data, op_name, other)
348+
self._compare_other(data, op_name, other)
351349

352350

353351
class TestCasting(object):

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ known_post_core=pandas.tseries,pandas.io,pandas.plotting
9090
sections=FUTURE,STDLIB,THIRDPARTY,PRE_CORE,DTYPES,FIRSTPARTY,POST_CORE,LOCALFOLDER
9191

9292
known_first_party=pandas
93-
known_third_party=Cython,numpy,python-dateutil,pytz,pyarrow
93+
known_third_party=Cython,numpy,python-dateutil,pytz,pyarrow,pytest
9494
multi_line_output=4
9595
force_grid_wrap=0
9696
combine_as_imports=True

0 commit comments

Comments
 (0)