Skip to content

TST: Fixturize series/test_combine_concat.py #22964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions pandas/tests/series/test_combine_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,28 @@
from pandas.util.testing import assert_series_equal
import pandas.util.testing as tm

from .common import TestData

class TestSeriesCombine():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only comment I have (applicable to your other PRs) is that I thought that these would have to inherit from object for compatibility but looks like tests are passing and this inheritance idiom is used in a few other instances, so may have just been a misunderstanding on my end. If anyone else knows if that's a requirement for something else LMK


class TestSeriesCombine(TestData):

def test_append(self):
appendedSeries = self.series.append(self.objSeries)
def test_append(self, datetime_series, string_series, object_series):
appendedSeries = string_series.append(object_series)
for idx, value in compat.iteritems(appendedSeries):
if idx in self.series.index:
assert value == self.series[idx]
elif idx in self.objSeries.index:
assert value == self.objSeries[idx]
if idx in string_series.index:
assert value == string_series[idx]
elif idx in object_series.index:
assert value == object_series[idx]
else:
raise AssertionError("orphaned index!")

pytest.raises(ValueError, self.ts.append, self.ts,
pytest.raises(ValueError, datetime_series.append, datetime_series,
verify_integrity=True)

def test_append_many(self):
pieces = [self.ts[:5], self.ts[5:10], self.ts[10:]]
def test_append_many(self, datetime_series):
pieces = [datetime_series[:5], datetime_series[5:10],
datetime_series[10:]]

result = pieces[0].append(pieces[1:])
assert_series_equal(result, self.ts)
assert_series_equal(result, datetime_series)

def test_append_duplicates(self):
# GH 13677
Expand Down