Skip to content

Commit 866db2f

Browse files
Liam3851TomAugspurger
authored andcommitted
Move GH16808 tests to their own method.
1 parent 09c1c9f commit 866db2f

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

pandas/tests/test_strings.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -431,16 +431,6 @@ def test_replace(self):
431431
values = klass(data)
432432
pytest.raises(TypeError, values.str.replace, 'a', repl)
433433

434-
# GH16808 literal replace (regex=False vs regex=True)
435-
values = Series(['f.o', 'foo', NA])
436-
exp = Series(['bao', 'bao', NA])
437-
result = values.str.replace('f.', 'ba')
438-
tm.assert_series_equal(result, exp)
439-
440-
exp = Series(['bao', 'foo', NA])
441-
result = values.str.replace('f.', 'ba', regex=False)
442-
tm.assert_series_equal(result, exp)
443-
444434
def test_replace_callable(self):
445435
# GH 15055
446436
values = Series(['fooBAD__barBAD', NA])
@@ -451,8 +441,6 @@ def test_replace_callable(self):
451441
exp = Series(['foObaD__baRbaD', NA])
452442
tm.assert_series_equal(result, exp)
453443

454-
pytest.raises(ValueError, values.str.replace, 'abc', repl, regex=False)
455-
456444
# test with wrong number of arguments, raising an error
457445
if compat.PY2:
458446
p_err = r'takes (no|(exactly|at (least|most)) ?\d+) arguments?'
@@ -534,8 +522,6 @@ def test_replace_compiled_regex(self):
534522
"case and flags cannot be"):
535523
result = values.str.replace(pat, '', case=True)
536524

537-
pytest.raises(ValueError, values.str.replace, pat, '', regex=False)
538-
539525
# test with callable
540526
values = Series(['fooBAD__barBAD', NA])
541527
repl = lambda m: m.group(0).swapcase()

0 commit comments

Comments
 (0)