|
|
@@ -4,7 +4,6 @@ |
|
|
import six
|
|
|
|
|
|
import os
|
|
|
-import sys
|
|
|
import tempfile
|
|
|
import warnings
|
|
|
|
|
|
@@ -15,6 +14,14 @@ |
|
|
get_fontconfig_fonts, is_opentype_cff_font, fontManager as fm)
|
|
|
from matplotlib import rc_context
|
|
|
|
|
|
+if six.PY2:
|
|
|
+ from distutils.spawn import find_executable
|
|
|
+ has_fclist = find_executable('fc-list') is not None
|
|
|
+else:
|
|
|
+ # py >= 3.3
|
|
|
+ from shutil import which
|
|
|
+ has_fclist = which('fc-list') is not None
|
|
|
+
|
|
|
|
|
|
def test_font_priority():
|
|
|
with rc_context(rc={
|
|
|
@@ -65,6 +72,6 @@ def test_otf(): |
|
|
assert res == is_opentype_cff_font(f)
|
|
|
|
|
|
|
|
|
-@pytest.mark.skipif(sys.platform == 'win32', reason='no fontconfig on Windows')
|
|
|
+@pytest.mark.skipif(not has_fclist, reason='no fontconfig installed')
|
|
|
def test_get_fontconfig_fonts():
|
|
|
assert len(get_fontconfig_fonts()) > 1
|