Skip to content

Commit

Permalink
More proper oop
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Jul 21, 2017
1 parent 4f8b133 commit 0a7a362
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pandas/tests/series/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
class SharedWithSparse(object):

def _assert_series_equal(self, left, right):
"""Helper dispatching to series class dependent assertion"""
if isinstance(left, SparseSeries) or isinstance(right, SparseSeries):
return tm.assert_sp_series_equal(left, right)
return tm.assert_series_equal(left, right)
"""Dispatch to series class dependent assertion"""
raise NotImplementedError

def test_scalarop_preserve_name(self):
result = self.ts * 2
Expand Down Expand Up @@ -196,6 +194,7 @@ def test_constructor_dict_timedelta_index(self):
class TestSeriesMisc(TestData, SharedWithSparse):

series_klass = Series
_assert_series_equal = staticmethod(tm.assert_series_equal)

def test_tab_completion(self):
# GH 9910
Expand Down
1 change: 1 addition & 0 deletions pandas/tests/sparse/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def _test_data2_zero():
class TestSparseSeries(SharedWithSparse):

series_klass = SparseSeries
_assert_series_equal = staticmethod(tm.assert_sp_series_equal)

def setup_method(self, method):
arr, index = _test_data1()
Expand Down

0 comments on commit 0a7a362

Please sign in to comment.