Skip to content

TST: skip fc-list related tests if not installed #8213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/matplotlib/tests/test_font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import six

import os
import sys
import tempfile
import warnings

Expand All @@ -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={
Expand Down Expand Up @@ -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