diff --git a/xarray/tests/test_plot.py b/xarray/tests/test_plot.py index e358bd47485..0c4dd5a29f2 100644 --- a/xarray/tests/test_plot.py +++ b/xarray/tests/test_plot.py @@ -185,6 +185,11 @@ def test_label_from_attrs(self): da.attrs.pop("units") assert "a" == label_from_attrs(da) + # Latex strings can be longer without needing a new line: + long_latex_name = r"$Ra_s = \mathrm{mean}(\epsilon_k) / \mu M^2_\infty$" + da.attrs = dict(long_name=long_latex_name) + assert label_from_attrs(da) == long_latex_name + def test1d(self): self.darray[:, 0, 0].plot() @@ -2950,10 +2955,3 @@ def test_datarray_scatter(x, y, z, hue, markersize, row, col, add_legend, add_co add_legend=add_legend, add_colorbar=add_colorbar, ) - - -def test_latex_name_isnt_split(): - da = xr.DataArray() - long_latex_name = r"$Ra_s = \mathrm{mean}(\epsilon_k) / \mu M^2_\infty$" - da.attrs = dict(long_name=long_latex_name) - assert label_from_attrs(da) == long_latex_name