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

Function test_apply_map_header_mi

pandas/tests/io/formats/style/test_style.py:458–466  ·  view source on GitHub ↗
(mi_styler, method, axis)

Source from the content-addressed store, hash-verified

456@pytest.mark.parametrize("method", ["apply", "map"])
457@pytest.mark.parametrize("axis", ["index", "columns"])
458def test_apply_map_header_mi(mi_styler, method, axis):
459 # GH 41893
460 func = {
461 "apply": lambda s: ["attr: val;" if "b" in v else "" for v in s],
462 "map": lambda v: "attr: val" if "b" in v else "",
463 }
464 result = getattr(mi_styler, f"{method}_index")(func[method], axis=axis)._compute()
465 expected = {(1, 1): [("attr", "val")]}
466 assert getattr(result, f"ctx_{axis}") == expected
467
468
469def test_apply_map_header_raises(mi_styler):

Callers

nothing calls this directly

Calls 1

_computeMethod · 0.80

Tested by

no test coverage detected