Permalink
Browse files

taup plot test: make it possible to get the expected failure on Travis

minimum dependency build

we have such a high tolerance for that build that it needs to be lowered
to actually get the expected failure
  • Loading branch information...
megies committed Oct 9, 2017
1 parent 584b760 commit 9bd3a80ea96e1209a1d7de88b9b343fc1ff1305d
Showing with 9 additions and 1 deletion.
  1. +9 −1 obspy/taup/tests/test_plotting.py
@@ -14,6 +14,7 @@
import matplotlib as mpl
import matplotlib.pyplot as plt
from obspy.core.util import MATPLOTLIB_VERSION
from obspy.core.util.testing import ImageComparison, ImageComparisonException
from obspy.core.util.deprecation_helpers import ObsPyDeprecationWarning
from obspy.taup import TauPyModel, plot_travel_times
@@ -187,10 +188,17 @@ def _test_plot_all(plot_all):
_test_plot_all(plot_all=False)
plt.savefig(ic.name)
# same test should fail if plot_all=True
tol = {}
# adjust tolerance on Travis minimum dependency build, tolerance is set
# so high for that build that image comparison can virtually never
# fail..
if MATPLOTLIB_VERSION < [1, 2]:
tol['reltol'] = 5
tol['adjust_tolerance'] = False
with self.assertRaises(ImageComparisonException):
with ImageComparison(
self.image_dir, "traveltimes_plot_all_False.png",
no_uploads=True) as ic:
no_uploads=True, **tol) as ic:
_test_plot_all(plot_all=True)
plt.savefig(ic.name)

0 comments on commit 9bd3a80

Please sign in to comment.