From a9500065da796b481a518d0bfdd4c9258f5c11da Mon Sep 17 00:00:00 2001 From: Jens Hedegaard Nielsen Date: Thu, 31 Dec 2015 12:22:22 +0000 Subject: [PATCH 1/3] Skip svg tex test if tex is not installed --- lib/matplotlib/tests/test_backend_svg.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/matplotlib/tests/test_backend_svg.py b/lib/matplotlib/tests/test_backend_svg.py index f655a56ca901..397ae3211b63 100644 --- a/lib/matplotlib/tests/test_backend_svg.py +++ b/lib/matplotlib/tests/test_backend_svg.py @@ -10,6 +10,11 @@ import matplotlib.pyplot as plt from matplotlib.testing.decorators import cleanup from matplotlib.testing.decorators import image_comparison +import matplotlib + +needs_tex = knownfailureif( + not matplotlib.checkdep_tex(), + "This test needs a TeX installation") @cleanup @@ -173,6 +178,7 @@ def test_determinism_notex(): @cleanup +@needs_tex def test_determinism_tex(): # unique filename to allow for parallel testing _test_determinism('determinism_tex.svg', usetex=True) From 5c5a37d5283893ad3afab6582afcdd9d71da4d8f Mon Sep 17 00:00:00 2001 From: Jens Hedegaard Nielsen Date: Thu, 31 Dec 2015 12:38:38 +0000 Subject: [PATCH 2/3] remember to import knowfailureif --- lib/matplotlib/tests/test_backend_svg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_backend_svg.py b/lib/matplotlib/tests/test_backend_svg.py index 397ae3211b63..38116fab4fe7 100644 --- a/lib/matplotlib/tests/test_backend_svg.py +++ b/lib/matplotlib/tests/test_backend_svg.py @@ -9,7 +9,7 @@ import matplotlib.pyplot as plt from matplotlib.testing.decorators import cleanup -from matplotlib.testing.decorators import image_comparison +from matplotlib.testing.decorators import image_comparison, knownfailureif import matplotlib needs_tex = knownfailureif( From 16698e8dfa1ca084982042a4e7518900e969973f Mon Sep 17 00:00:00 2001 From: Jens Hedegaard Nielsen Date: Thu, 31 Dec 2015 15:43:18 +0000 Subject: [PATCH 3/3] Also catch RuntimeErrors Borrowed from #5677 which is not backported to 2.x --- lib/matplotlib/textpath.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/textpath.py b/lib/matplotlib/textpath.py index c063c3ad9fa6..b69461917769 100644 --- a/lib/matplotlib/textpath.py +++ b/lib/matplotlib/textpath.py @@ -345,7 +345,7 @@ def get_glyphs_tex(self, prop, s, glyph_map=None, 1094995778)]: try: font.select_charmap(charmap_code) - except ValueError: + except (ValueError, RuntimeError): pass else: break