Skip to content

Commit 5ab99ee

Browse files
authored
Merge pull request matplotlib#19108 from anntzer/animtests
Fix failing animation test with pytest 6.2.
2 parents 067cdee + 48c18cb commit 5ab99ee

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/matplotlib/tests/test_animation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ def test_animation_repr_html(writer, html, want, anim):
197197
html = anim._repr_html_()
198198
if want is None:
199199
assert html is None
200+
with pytest.warns(UserWarning):
201+
del anim # Animtion was never run, so will warn on cleanup.
200202
else:
201203
assert want in html
202204

lib/matplotlib/tests/test_image.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,8 @@ def test_load_from_url():
707707
+ ('///' if sys.platform == 'win32' else '')
708708
+ path.resolve().as_posix())
709709
plt.imread(url)
710-
plt.imread(urllib.request.urlopen(url))
710+
with urllib.request.urlopen(url) as file:
711+
plt.imread(file)
711712

712713

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

0 commit comments

Comments
 (0)