Skip to content

Remove TestData from series-tests test_repr.py #29148

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
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
26 changes: 12 additions & 14 deletions pandas/tests/series/test_repr.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
from pandas.core.index import MultiIndex
import pandas.util.testing as tm

from .common import TestData


class TestSeriesRepr(TestData):
class TestSeriesRepr:
def test_multilevel_name_print(self):
index = MultiIndex(
levels=[["foo", "bar", "baz", "qux"], ["one", "two", "three"]],
Expand Down Expand Up @@ -67,24 +65,24 @@ def test_name_printing(self):
s = Series(index=date_range("20010101", "20020101"), name="test")
assert "Name: test" in repr(s)

def test_repr(self):
str(self.ts)
str(self.series)
str(self.series.astype(int))
str(self.objSeries)
def test_repr(self, datetime_series, string_series, object_series):
str(datetime_series)
str(string_series)
str(string_series.astype(int))
str(object_series)

str(Series(tm.randn(1000), index=np.arange(1000)))
str(Series(tm.randn(1000), index=np.arange(1000, 0, step=-1)))

# empty
str(self.empty)
str(Series())

# with NaNs
self.series[5:7] = np.NaN
str(self.series)
string_series[5:7] = np.NaN
str(string_series)

# with Nones
ots = self.ts.astype("O")
ots = datetime_series.astype("O")
ots[::2] = None
repr(ots)

Expand All @@ -102,8 +100,8 @@ def test_repr(self):
("\u03B1", "\u03B2", "\u03B3"),
("\u03B1", "bar"),
]:
self.series.name = name
repr(self.series)
string_series.name = name
repr(string_series)

biggie = Series(
tm.randn(1000), index=np.arange(1000), name=("foo", "bar", "baz")
Expand Down