@@ -166,13 +166,9 @@ def test_str_cat(self, series_or_index):
166
166
# Series/Index with Series
167
167
t = Series (t )
168
168
# s as Series has same index as t -> no warning
169
- # s as Index is different from t.index -> warning
169
+ # s as Index is different from t.index -> warning (tested below)
170
170
if series_or_index == 'series' :
171
171
assert_series_equal (s .str .cat (t , na_rep = '-' ), exp )
172
- else :
173
- with tm .assert_produces_warning (expected_warning = FutureWarning ):
174
- # FutureWarning to switch to alignment by default
175
- assert_series_or_index_equal (s .str .cat (t , na_rep = '-' ), exp )
176
172
177
173
# Series/Index with Series: warning if different indexes
178
174
t .index = t .index + 1
@@ -241,13 +237,9 @@ def test_str_cat_categorical(self, series_or_index,
241
237
# Series/Index with Series
242
238
t = Series (t )
243
239
# s as Series has same index as t -> no warning
244
- # s as Index is different from t.index -> warning
240
+ # s as Index is different from t.index -> warning (tested below)
245
241
if series_or_index == 'series' :
246
242
assert_series_equal (s .str .cat (t ), exp )
247
- else :
248
- with tm .assert_produces_warning (expected_warning = FutureWarning ):
249
- # FutureWarning to switch to alignment by default
250
- assert_series_or_index_equal (s .str .cat (t ), exp )
251
243
252
244
# Series/Index with Series: warning if different indexes
253
245
t .index = t .index + 1
@@ -269,13 +261,9 @@ def test_str_cat_mixed_inputs(self, series_or_index):
269
261
270
262
# Series/Index with DataFrame
271
263
# s as Series has same index as d -> no warning
272
- # s as Index is different from d.index -> warning
264
+ # s as Index is different from d.index -> warning (tested below)
273
265
if series_or_index == 'series' :
274
266
assert_series_equal (s .str .cat (d ), exp )
275
- else :
276
- with tm .assert_produces_warning (expected_warning = FutureWarning ):
277
- # FutureWarning to switch to alignment by default
278
- assert_series_or_index_equal (s .str .cat (d ), exp )
279
267
280
268
# Series/Index with DataFrame: warning if different indexes
281
269
d .index = d .index + 1
@@ -288,13 +276,9 @@ def test_str_cat_mixed_inputs(self, series_or_index):
288
276
289
277
# Series/Index with list of Series
290
278
# s as Series has same index as t, s -> no warning
291
- # s as Index is different from t.index -> warning
279
+ # s as Index is different from t.index -> warning (tested below)
292
280
if series_or_index == 'series' :
293
281
assert_series_equal (s .str .cat ([t , s ]), exp )
294
- else :
295
- with tm .assert_produces_warning (expected_warning = FutureWarning ):
296
- # FutureWarning to switch to alignment by default
297
- assert_series_or_index_equal (s .str .cat ([t , s ]), exp )
298
282
299
283
# Series/Index with list of Series: warning if different indexes
300
284
tt = t .copy ()
@@ -308,13 +292,9 @@ def test_str_cat_mixed_inputs(self, series_or_index):
308
292
309
293
# Series/Index with mixed list of Series/list-like
310
294
# s as Series has same index as t -> no warning
311
- # s as Index is different from t.index -> warning
295
+ # s as Index is different from t.index -> warning (tested below)
312
296
if series_or_index == 'series' :
313
297
assert_series_equal (s .str .cat ([t , s .values ]), exp )
314
- else :
315
- with tm .assert_produces_warning (expected_warning = FutureWarning ):
316
- # FutureWarning to switch to alignment by default
317
- assert_series_or_index_equal (s .str .cat ([t , s .values ]), exp )
318
298
319
299
# Series/Index with mixed list: warning if different indexes
320
300
with tm .assert_produces_warning (expected_warning = FutureWarning ):
0 commit comments