Skip to content

Commit a7fd1e6

Browse files
committed
Removed duplicate tests
1 parent 04694a5 commit a7fd1e6

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

pandas/tests/test_strings.py

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,9 @@ def test_str_cat(self, series_or_index):
166166
# Series/Index with Series
167167
t = Series(t)
168168
# 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)
170170
if series_or_index == 'series':
171171
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)
176172

177173
# Series/Index with Series: warning if different indexes
178174
t.index = t.index + 1
@@ -241,13 +237,9 @@ def test_str_cat_categorical(self, series_or_index,
241237
# Series/Index with Series
242238
t = Series(t)
243239
# 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)
245241
if series_or_index == 'series':
246242
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)
251243

252244
# Series/Index with Series: warning if different indexes
253245
t.index = t.index + 1
@@ -269,13 +261,9 @@ def test_str_cat_mixed_inputs(self, series_or_index):
269261

270262
# Series/Index with DataFrame
271263
# 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)
273265
if series_or_index == 'series':
274266
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)
279267

280268
# Series/Index with DataFrame: warning if different indexes
281269
d.index = d.index + 1
@@ -288,13 +276,9 @@ def test_str_cat_mixed_inputs(self, series_or_index):
288276

289277
# Series/Index with list of Series
290278
# 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)
292280
if series_or_index == 'series':
293281
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)
298282

299283
# Series/Index with list of Series: warning if different indexes
300284
tt = t.copy()
@@ -308,13 +292,9 @@ def test_str_cat_mixed_inputs(self, series_or_index):
308292

309293
# Series/Index with mixed list of Series/list-like
310294
# 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)
312296
if series_or_index == 'series':
313297
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)
318298

319299
# Series/Index with mixed list: warning if different indexes
320300
with tm.assert_produces_warning(expected_warning=FutureWarning):

0 commit comments

Comments
 (0)