(self)
| 2502 | |
| 2503 | @pytest.mark.slow |
| 2504 | def test_units_appear_somewhere(self) -> None: |
| 2505 | # assign coordinates to all dims so we can test for units |
| 2506 | darray = self.darray.assign_coords( |
| 2507 | {"x": np.arange(self.darray.x.size), "y": np.arange(self.darray.y.size)} |
| 2508 | ) |
| 2509 | |
| 2510 | darray.x.attrs["units"] = "x_unit" |
| 2511 | darray.y.attrs["units"] = "y_unit" |
| 2512 | |
| 2513 | g = xplt.FacetGrid(darray, col="z") |
| 2514 | |
| 2515 | g.map_dataarray(xplt.contourf, "x", "y") |
| 2516 | |
| 2517 | alltxt = text_in_fig() |
| 2518 | |
| 2519 | # unit should appear as e.g. 'x [x_unit]' |
| 2520 | for unit_name in ["x_unit", "y_unit"]: |
| 2521 | assert unit_name in "".join(alltxt) |
| 2522 | |
| 2523 | |
| 2524 | @pytest.mark.filterwarnings("ignore:tight_layout cannot") |
nothing calls this directly
no test coverage detected