Skip to content

Fix failing animation test with pytest 6.2. #19108

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 1 commit into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions lib/matplotlib/tests/test_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ def test_animation_repr_html(writer, html, want, anim):
html = anim._repr_html_()
if want is None:
assert html is None
with pytest.warns(UserWarning):
del anim # Animtion was never run, so will warn on cleanup.
else:
assert want in html

Expand Down
3 changes: 2 additions & 1 deletion lib/matplotlib/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,8 @@ def test_load_from_url():
+ ('///' if sys.platform == 'win32' else '')
+ path.resolve().as_posix())
plt.imread(url)
plt.imread(urllib.request.urlopen(url))
with urllib.request.urlopen(url) as file:
plt.imread(file)


@image_comparison(['log_scale_image'], remove_text=True)
Expand Down