Skip to content

Commit 670fb5a

Browse files
committedApr 3, 2025
TST: Set check_figures_equal default to PNG only
1 parent ee70174 commit 670fb5a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+215
-210
lines changed
 
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

+2-2
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

0 commit comments

Comments
 (0)