def test_show_hist(): """ This test only verifies that code up to the point of plotting with matplotlib works correctly. Tests do not exercise matplotlib. """ if plt: # Return because plotting causes the tests to block until the plot # window is closed. return with rasterio.open('tests/data/RGB.byte.tif') as src: try: show_hist((src, 1), bins=256) except ImportError: pass try: show_hist(src.read(), bins=256) except ImportError: pass
def test_show_hist(): """ This test only verifies that code up to the point of plotting with matplotlib works correctly. Tests do not exercise matplotlib. """ with rasterio.open('tests/data/RGB.byte.tif') as src: try: show_hist((src, 1), bins=256) fig = plt.gcf() plt.close(fig) except ImportError: pass try: show_hist(src.read(), bins=256) fig = plt.gcf() plt.close(fig) except ImportError: pass