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

Function test_findall_lookarounds

pandas/tests/strings/test_find_replace.py:1522–1535  ·  view source on GitHub ↗
(any_string_dtype, pat, expected_data)

Source from the content-addressed store, hash-verified

1520 ],
1521)
1522def test_findall_lookarounds(any_string_dtype, pat, expected_data):
1523 # https://github.com/pandas-dev/pandas/issues/60833
1524 ser = Series(["aa", "ab", "ba", "bb", None], dtype=any_string_dtype)
1525 result = ser.str.findall(pat)
1526 if any_string_dtype == "object":
1527 null_result = None
1528 elif any_string_dtype == "str":
1529 null_result = np.nan
1530 elif any_string_dtype == "string":
1531 null_result = pd.NA
1532 else:
1533 raise ValueError(f"Unrecognized dtype: {any_string_dtype}")
1534 expected = Series([*expected_data, null_result])
1535 tm.assert_series_equal(result, expected)
1536
1537
1538def test_findall_end_of_string(any_string_dtype):

Callers

nothing calls this directly

Calls 2

SeriesClass · 0.90
findallMethod · 0.80

Tested by

no test coverage detected