MCPcopy
hub / github.com/pandas-dev/pandas / test_replace_callable_raises

Function test_replace_callable_raises

pandas/tests/strings/test_find_replace.py:653–663  ·  view source on GitHub ↗
(any_string_dtype, repl)

Source from the content-addressed store, hash-verified

651 "repl", [lambda: None, lambda m, x: None, lambda m, x, y=None: None]
652)
653def test_replace_callable_raises(any_string_dtype, repl):
654 # GH 15055
655 values = Series(["fooBAD__barBAD", np.nan], dtype=any_string_dtype)
656
657 # test with wrong number of arguments, raising an error
658 msg = (
659 r"((takes)|(missing)) (?(2)from \d+ to )?\d+ "
660 r"(?(3)required )positional arguments?"
661 )
662 with pytest.raises(TypeError, match=msg):
663 values.str.replace("a", repl, regex=True)
664
665
666@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

SeriesClass · 0.90
raisesMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected