Skip to content

Commit a12c295

Browse files
committed
Parametrize pat in test_string_extract_nonparticipating_group
1 parent 4eafc94 commit a12c295

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

python/cudf/cudf/tests/series/accessors/test_str.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2530,17 +2530,17 @@ def test_string_extract(ps_gs, pat, expand, flags, flags_raise):
25302530
assert_eq(expect, got)
25312531

25322532

2533-
def test_string_extract_nonparticipating_group():
2533+
@pytest.mark.parametrize("pat", [r"(\D)(\d)?", r"(\D)(\d*)"])
2534+
def test_string_extract_nonparticipating_group(pat):
25342535
# An optional group that does not participate in the match results in
25352536
# null, while a group that participates with an empty match remains "".
25362537
s = ["A1", "B2", "C"]
25372538
gs = cudf.Series(s)
25382539
ps = pd.Series(s)
25392540

2540-
for pat in [r"(\D)(\d)?", r"(\D)(\d*)"]:
2541-
expect = ps.str.extract(pat, expand=True)
2542-
got = gs.str.extract(pat, expand=True)
2543-
assert_eq(expect, got)
2541+
expect = ps.str.extract(pat, expand=True)
2542+
got = gs.str.extract(pat, expand=True)
2543+
assert_eq(expect, got)
25442544

25452545

25462546
def test_string_extract_named_groups():

0 commit comments

Comments
 (0)