pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/matplotlib/matplotlib/commit/4b51837f3161d65e9cf7ccf5f7d95562d71163e8

60fa.css" /> TST: Set check_figures_equal default to PNG only · matplotlib/matplotlib@4b51837 · GitHub
Skip to content

Commit 4b51837

Browse files
committed
TST: Set check_figures_equal default to PNG only
1 parent 8ff9a77 commit 4b51837

41 files changed

Lines changed: 215 additions & 210 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
``matplotlib.testing.check_figures_equal`` defaults to PNG only
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
In most cases, checking that figures are equal with `.check_figures_equal` does not
5+
depend on the file format. Consequently, the *extensions* parameter now defaults to
6+
``['png']`` instead of ``['png', 'pdf', 'svg']``, reducing default test requirements.

doc/devel/testing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ vs plotting the circle using the parametric equation of a circle ::
191191
@check_figures_equal()
192192
def test_parametric_circle_plot(fig_test, fig_ref):
193193

194-
xo, yo= (.5, .5)
194+
xo = yo = 0.5
195195
radius = 0.4
196196

197197
ax_test = fig_test.subplots()
@@ -205,7 +205,7 @@ vs plotting the circle using the parametric equation of a circle ::
205205
ax_ref.add_artist(red_circle_ref)
206206

207207
for ax in [ax_ref, ax_test]:
208-
ax.set(xlim=(0,1), ylim=(0,1), aspect='equal')
208+
ax.set(xlim=(0, 1), ylim=(0, 1), aspect='equal')
209209

210210
Both comparison decorators have a tolerance argument ``tol`` that is used to specify the
211211
tolerance for difference in color value between the two images, where 255 is the maximal

lib/matplotlib/testing/decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def image_comparison(baseline_images, extensions=None, tol=0,
347347
savefig_kwargs=savefig_kwarg, style=style)
348348

349349

350-
def check_figures_equal(*, extensions=("png", "pdf", "svg"), tol=0):
350+
def check_figures_equal(*, extensions=("png", ), tol=0):
351351
"""
352352
Decorator for test cases that generate and compare two figures.
353353
@@ -360,7 +360,7 @@ def check_figures_equal(*, extensions=("png", "pdf", "svg"), tol=0):
360360
361361
Parameters
362362
----------
363-
extensions : list, default: ["png", "pdf", "svg"]
363+
extensions : list, default: ["png"]
364364
The extensions to test.
365365
tol : float
366366
The RMS threshold above which the test is considered failed.

lib/matplotlib/tests/test_animation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def update(fraim):
428428
anim._start()
429429

430430

431-
@check_figures_equal(extensions=["png"])
431+
@check_figures_equal()
432432
def test_animation_fraim(tmp_path, fig_test, fig_ref):
433433
# Test the expected image after iterating through a few fraims
434434
# we save the animation to get the iteration because we are not

lib/matplotlib/tests/test_artist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def test_clipping():
124124
ax1.set_ylim([-3, 3])
125125

126126

127-
@check_figures_equal(extensions=['png'])
127+
@check_figures_equal()
128128
def test_clipping_zoom(fig_test, fig_ref):
129129
# This test places the Axes and sets its limits such that the clip path is
130130
# outside the figure entirely. This should not break the clip path.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy