MCPcopy
hub / github.com/pydata/xarray / test_extract_multi_None_raises

Function test_extract_multi_None_raises

xarray/tests/test_accessor_str.py:577–593  ·  view source on GitHub ↗
(dtype)

Source from the content-addressed store, hash-verified

575
576
577def test_extract_multi_None_raises(dtype) -> None:
578 pat_str = r"(\w+)_(\d+)"
579 pat_re = re.compile(pat_str)
580
581 value = xr.DataArray([["a_b"]], dims=["X", "Y"]).astype(dtype)
582
583 with pytest.raises(
584 ValueError,
585 match=r"Dimension must be specified if more than one capture group is given.",
586 ):
587 value.str.extract(pat=pat_str, dim=None)
588
589 with pytest.raises(
590 ValueError,
591 match=r"Dimension must be specified if more than one capture group is given.",
592 ):
593 value.str.extract(pat=pat_re, dim=None)
594
595
596def test_extract_extractall_findall_case_re_raises(dtype) -> None:

Callers

nothing calls this directly

Calls 2

extractMethod · 0.80
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…