title: PyTest Matplotlib Figure Appears on Show
body: <p>I have a complicated method called <code>plotter()</code> which processes some data and produces a matplotlib plot with several components. Due to its complexity I simply want to test that the plot appears. This will confirm that all of the data is processed reasonably and that something gets shown without any errors being thrown. I am not looking to run an image comparison as that's not currently possible for this project.</p>
  
  <p>My function is too complicated to show here, so the following example could be considered instead.</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  
  def plotter():
      x = np.arange(0,10)
      y = 2*x
      fig = plt.plot(x, y)
  
  plotter()
  plt.show()
  </code></pre>
  
  <p>Is there a way to use PyTest to simply assert that a figure appears? If not then solutions using other test frameworks would also be greatly appreciated.</p>
  
  <p>(For context I am using Python 3.)</p>