Skip to content

Commit

Permalink
Fix errors in test_latex_name_isnt_split for min environments (#5710)
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan authored Aug 18, 2021
1 parent 4109966 commit de867e6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions xarray/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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

0 comments on commit de867e6

Please sign in to comment.