@@ -142,39 +142,35 @@ def test_multiindex_objects(self):
142
142
tm .assert_numpy_array_equal (np .sort (result ),
143
143
np .sort (expected ))
144
144
145
- def test_hash_pandas_object (self ):
146
-
147
- for obj in [Series ([1 , 2 , 3 ]),
148
- Series ([1.0 , 1.5 , 3.2 ]),
149
- Series ([1.0 , 1.5 , np .nan ]),
150
- Series ([1.0 , 1.5 , 3.2 ], index = [1.5 , 1.1 , 3.3 ]),
151
- Series (['a' , 'b' , 'c' ]),
152
- Series (['a' , np .nan , 'c' ]),
153
- Series (['a' , None , 'c' ]),
154
- Series ([True , False , True ]),
155
- Series (),
156
- Index ([1 , 2 , 3 ]),
157
- Index ([True , False , True ]),
158
- DataFrame ({'x' : ['a' , 'b' , 'c' ], 'y' : [1 , 2 , 3 ]}),
159
- DataFrame (),
160
- tm .makeMissingDataframe (),
161
- tm .makeMixedDataFrame (),
162
- tm .makeTimeDataFrame (),
163
- tm .makeTimeSeries (),
164
- tm .makeTimedeltaIndex (),
165
- tm .makePeriodIndex (),
166
- Series (tm .makePeriodIndex ()),
167
- Series (pd .date_range ('20130101' ,
168
- periods = 3 , tz = 'US/Eastern' )),
169
- MultiIndex .from_product (
170
- [range (5 ),
171
- ['foo' , 'bar' , 'baz' ],
172
- pd .date_range ('20130101' , periods = 2 )]),
173
- MultiIndex .from_product (
174
- [pd .CategoricalIndex (list ('aabc' )),
175
- range (3 )])]:
176
- self .check_equal (obj )
177
- self .check_not_equal_with_index (obj )
145
+ @pytest .mark .parametrize ('obj' , [
146
+ Series ([1 , 2 , 3 ]),
147
+ Series ([1.0 , 1.5 , 3.2 ]),
148
+ Series ([1.0 , 1.5 , np .nan ]),
149
+ Series ([1.0 , 1.5 , 3.2 ], index = [1.5 , 1.1 , 3.3 ]),
150
+ Series (['a' , 'b' , 'c' ]),
151
+ Series (['a' , np .nan , 'c' ]),
152
+ Series (['a' , None , 'c' ]),
153
+ Series ([True , False , True ]),
154
+ Series (),
155
+ Index ([1 , 2 , 3 ]),
156
+ Index ([True , False , True ]),
157
+ DataFrame ({'x' : ['a' , 'b' , 'c' ], 'y' : [1 , 2 , 3 ]}),
158
+ DataFrame (),
159
+ tm .makeMissingDataframe (),
160
+ tm .makeMixedDataFrame (),
161
+ tm .makeTimeDataFrame (),
162
+ tm .makeTimeSeries (),
163
+ tm .makeTimedeltaIndex (),
164
+ tm .makePeriodIndex (),
165
+ Series (tm .makePeriodIndex ()),
166
+ Series (pd .date_range ('20130101' , periods = 3 , tz = 'US/Eastern' )),
167
+ MultiIndex .from_product ([range (5 ), ['foo' , 'bar' , 'baz' ],
168
+ pd .date_range ('20130101' , periods = 2 )]),
169
+ MultiIndex .from_product ([pd .CategoricalIndex (list ('aabc' )), range (3 )])
170
+ ])
171
+ def test_hash_pandas_object (self , obj ):
172
+ self .check_equal (obj )
173
+ self .check_not_equal_with_index (obj )
178
174
179
175
def test_hash_pandas_object2 (self ):
180
176
for name , s in self .df .iteritems ():
0 commit comments