| 456 | @pytest.mark.parametrize("method", ["apply", "map"]) |
| 457 | @pytest.mark.parametrize("axis", ["index", "columns"]) |
| 458 | def 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 | |
| 469 | def test_apply_map_header_raises(mi_styler): |