Example that fails to execute (with normal thumbnail behaviour)#

By default, examples with code blocks that raise an error will have the broken image stamp as their gallery thumbnail. However, this may not be desired, e.g. if only part of the example is expected to fail and it should not look like the entire example fails.

In these cases, the sphinx_gallery_failing_thumbnail variable can be set to False, which will change the thumbnail selection to the default behaviour as for non-failing examples.

15 # Code source: Thomas S. Binns
16 # License: BSD 3 clause
17 # sphinx_gallery_line_numbers = True
18
19 # sphinx_gallery_failing_thumbnail = False
20
21 import matplotlib.pyplot as plt
22 import numpy as np
23
24 plt.pcolormesh(np.random.randn(100, 100))
plot raise thumbnail
<matplotlib.collections.QuadMesh object at 0x7ff487a04cd0>

This block will raise an AssertionError

29 assert False
Traceback (most recent call last):
  File "/home/circleci/project/examples/no_output/plot_raise_thumbnail.py", line 29, in <module>
    assert False
AssertionError

Total running time of the script: (0 minutes 0.786 seconds)

Estimated memory usage: 543 MB

Gallery generated by Sphinx-Gallery