Skip to content

Commit

Permalink
TST: Fix integer ops comparison test (pandas-dev#23619)
Browse files Browse the repository at this point in the history
The `op(Series[integer], other)` path was being tested twice.
The `op(IntegerArray, other)` path was not being tested.

Closes pandas-dev#22096
  • Loading branch information
TomAugspurger authored and JustinZhengBC committed Nov 14, 2018
1 parent b265308 commit f2eac44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions pandas/tests/arrays/test_integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,11 @@ def test_rpow_one_to_na(self):

class TestComparisonOps(BaseOpsUtil):

def _compare_other(self, s, data, op_name, other):
def _compare_other(self, data, op_name, other):
op = self.get_op_from_name(op_name)

# array
result = op(s, other)
result = pd.Series(op(data, other))
expected = pd.Series(op(data._data, other))

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

def test_compare_scalar(self, data, all_compare_operators):
op_name = all_compare_operators
s = pd.Series(data)
self._compare_other(s, data, op_name, 0)
self._compare_other(data, op_name, 0)

def test_compare_array(self, data, all_compare_operators):
op_name = all_compare_operators
s = pd.Series(data)
other = pd.Series([0] * len(data))
self._compare_other(s, data, op_name, other)
self._compare_other(data, op_name, other)


class TestCasting(object):
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ known_post_core=pandas.tseries,pandas.io,pandas.plotting
sections=FUTURE,STDLIB,THIRDPARTY,PRE_CORE,DTYPES,FIRSTPARTY,POST_CORE,LOCALFOLDER

known_first_party=pandas
known_third_party=Cython,numpy,python-dateutil,pytz,pyarrow
known_third_party=Cython,numpy,python-dateutil,pytz,pyarrow,pytest
multi_line_output=4
force_grid_wrap=0
combine_as_imports=True
Expand Down

0 comments on commit f2eac44

Please sign in to comment.