Skip to content

Commit 490d2bc

Browse files
committed
simpler example
1 parent 49c1666 commit 490d2bc

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

doc/devel/testing.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,11 @@ tests it::
152152
from matplotlib.testing.decorators import image_comparison
153153
import matplotlib.pyplot as plt
154154

155-
@image_comparison(baseline_images=['hexbin_empty'], remove_text=True,
155+
@image_comparison(baseline_images=['line_dashes'], remove_text=True,
156156
extensions=['png'])
157-
def test_hexbin_empty():
158-
# From #3886: creating hexbin from empty dataset raises ValueError
159-
ax = plt.gca()
160-
ax.hexbin([], [])
157+
def test_line_dashes():
158+
fig, ax = plt.subplots()
159+
ax.plot(range(10), linestyle=(0, (3, 3)), lw=5)
161160

162161
The first time this test is run, there will be no baseline image to compare
163162
against, so the test will fail. Copy the output images (in this case

lib/matplotlib/testing/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def image_comparison(baseline_images, extensions=None, tol=0,
368368
either as a parameter or with pytest.mark.usefixtures. This value is
369369
only allowed when using pytest.
370370
371-
extensions : [ None | list ]
371+
extensions : None or list of str
372372
The list of extensions to test, e.g. ``['png', 'pdf']``.
373373
374374
If *None*, defaults to all supported extensions: png, pdf, and svg.

0 commit comments

Comments
 (0)