1717from pandas .core .index import MultiIndex
1818import pandas .util .testing as tm
1919
20- from .common import TestData
2120
22-
23- class TestSeriesRepr (TestData ):
21+ class TestSeriesRepr :
2422 def test_multilevel_name_print (self ):
2523 index = MultiIndex (
2624 levels = [["foo" , "bar" , "baz" , "qux" ], ["one" , "two" , "three" ]],
@@ -67,24 +65,24 @@ def test_name_printing(self):
6765 s = Series (index = date_range ("20010101" , "20020101" ), name = "test" )
6866 assert "Name: test" in repr (s )
6967
70- def test_repr (self ):
71- str (self . ts )
72- str (self . series )
73- str (self . series .astype (int ))
74- str (self . objSeries )
68+ def test_repr (self , datetime_series , string_series , object_series ):
69+ str (datetime_series )
70+ str (string_series )
71+ str (string_series .astype (int ))
72+ str (object_series )
7573
7674 str (Series (tm .randn (1000 ), index = np .arange (1000 )))
7775 str (Series (tm .randn (1000 ), index = np .arange (1000 , 0 , step = - 1 )))
7876
7977 # empty
80- str (self . empty )
78+ str (Series () )
8179
8280 # with NaNs
83- self . series [5 :7 ] = np .NaN
84- str (self . series )
81+ string_series [5 :7 ] = np .NaN
82+ str (string_series )
8583
8684 # with Nones
87- ots = self . ts .astype ("O" )
85+ ots = datetime_series .astype ("O" )
8886 ots [::2 ] = None
8987 repr (ots )
9088
@@ -102,8 +100,8 @@ def test_repr(self):
102100 ("\u03B1 " , "\u03B2 " , "\u03B3 " ),
103101 ("\u03B1 " , "bar" ),
104102 ]:
105- self . series .name = name
106- repr (self . series )
103+ string_series .name = name
104+ repr (string_series )
107105
108106 biggie = Series (
109107 tm .randn (1000 ), index = np .arange (1000 ), name = ("foo" , "bar" , "baz" )
0 commit comments