Skip to content
Prev Previous commit
Next Next commit
Fix PEP8 line length in tests.
  • Loading branch information
Liam3851 authored and TomAugspurger committed Feb 27, 2018
commit a28ef8fbdcc8d846dc0194d6b3fee8b4024e7012
9 changes: 6 additions & 3 deletions pandas/tests/test_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,12 +541,15 @@ def test_replace_literal(self):
result = values.str.replace('f.', 'ba', regex=False)
tm.assert_series_equal(result, exp)

# Cannot do a literal replace if given a callable repl or compiled pattern
# Cannot do a literal replace if given a callable repl or compiled
# pattern
callable_repl = lambda m: m.group(0).swapcase()
compiled_pat = re.compile('[a-z][A-Z]{2}')

pytest.raises(ValueError, values.str.replace, 'abc', callable_repl, regex=False)
pytest.raises(ValueError, values.str.replace, compiled_pat, '', regex=False)
pytest.raises(ValueError, values.str.replace, 'abc', callable_repl,
regex=False)
pytest.raises(ValueError, values.str.replace, compiled_pat, '',
regex=False)

def test_repeat(self):
values = Series(['a', 'b', NA, 'c', NA, 'd'])
Expand Down