10000 Add typing to test_plot.py by Illviljan · Pull Request #8889 · pydata/xarray · GitHub
[go: up one dir, main page]

Skip to content

Add typing to test_plot.py #8889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Apr 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update test_plot.py
  • Loading branch information
Illviljan committed Mar 29, 2024
commit 0e8695c02ec0f72ac01be3204e9c55909a53f11a
4 changes: 2 additions & 2 deletions xarray/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def substring_in_axes(substring: str, ax: mpl.axes.Axes) -> bool:
"""
Return True if a substring is found anywhere in an axes
"""
alltxt: set[str] = {t.get_text() for t in ax.findobj(mpl.text.Text)}
alltxt: set[str] = {t.get_text() for t in ax.findobj(mpl.text.Text)} # type: ignore[attr-defined] # mpl error?
for txt in alltxt:
if substring in txt:
return True
Expand Down Expand Up @@ -2522,7 +2522,7 @@ def test_default_labels(self) -> None:

# Leftmost column should have array name
for ax in g.axs[:, 0]:
assert substring_in_axes(self.darray.name, ax)
assert substring_in_axes(str(self.darray.name), ax)

def test_test_empty_cell(self) -> None:
g = (
Expand Down
0