本文整理汇总了Python中matplotlib.ft2font.__freetype_build_type__方法的典型用法代码示例。如果您正苦于以下问题:Python ft2font.__freetype_build_type__方法的具体用法?Python ft2font.__freetype_build_type__怎么用?Python ft2font.__freetype_build_type__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.ft2font
的用法示例。
在下文中一共展示了ft2font.__freetype_build_type__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _init_tests
# 需要导入模块: from matplotlib import ft2font [as 别名]
# 或者: from matplotlib.ft2font import __freetype_build_type__ [as 别名]
def _init_tests():
# CPython's faulthandler since v3.6 handles exceptions on Windows
# https://bugs.python.org/issue23848 but until v3.6.4 it was printing
# non-fatal exceptions https://bugs.python.org/issue30557
import platform
if not (sys.platform == 'win32' and
(3, 6) < sys.version_info < (3, 6, 4) and
platform.python_implementation() == 'CPython'):
import faulthandler
faulthandler.enable()
# The version of FreeType to install locally for running the
# tests. This must match the value in `setupext.py`
LOCAL_FREETYPE_VERSION = '2.6.1'
from matplotlib import ft2font
if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
ft2font.__freetype_build_type__ != 'local'):
_log.warning(
"Matplotlib is not built with the correct FreeType version to run "
"tests. Set local_freetype=True in setup.cfg and rebuild. "
"Expect many image comparison failures below. "
"Expected freetype version {0}. "
"Found freetype version {1}. "
"Freetype build type is {2}local".format(
LOCAL_FREETYPE_VERSION,
ft2font.__freetype_version__,
"" if ft2font.__freetype_build_type__ == 'local' else "not "))
try:
import pytest
except ImportError:
print("matplotlib.test requires pytest to run.")
raise
示例2: _init_tests
# 需要导入模块: from matplotlib import ft2font [as 别名]
# 或者: from matplotlib.ft2font import __freetype_build_type__ [as 别名]
def _init_tests():
# CPython's faulthandler since v3.6 handles exceptions on Windows
# https://bugs.python.org/issue23848 but until v3.6.4 it was printing
# non-fatal exceptions https://bugs.python.org/issue30557
import platform
if not (sys.platform == 'win32' and
(3, 6) < sys.version_info < (3, 6, 4) and
platform.python_implementation() == 'CPython'):
import faulthandler
faulthandler.enable()
# The version of FreeType to install locally for running the
# tests. This must match the value in `setupext.py`
LOCAL_FREETYPE_VERSION = '2.6.1'
from matplotlib import ft2font
if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
ft2font.__freetype_build_type__ != 'local'):
warnings.warn(
"Matplotlib is not built with the correct FreeType version to run "
"tests. Set local_freetype=True in setup.cfg and rebuild. "
"Expect many image comparison failures below. "
"Expected freetype version {0}. "
"Found freetype version {1}. "
"Freetype build type is {2}local".format(
LOCAL_FREETYPE_VERSION,
ft2font.__freetype_version__,
"" if ft2font.__freetype_build_type__ == 'local' else "not "
)
)
try:
import pytest
except ImportError:
print("matplotlib.test requires pytest to run.")
raise
示例3: _init_tests
# 需要导入模块: from matplotlib import ft2font [as 别名]
# 或者: from matplotlib.ft2font import __freetype_build_type__ [as 别名]
def _init_tests():
try:
import faulthandler
except ImportError:
pass
else:
# CPython's faulthandler since v3.6 handles exceptions on Windows
# https://bugs.python.org/issue23848 but until v3.6.4 it was
# printing non-fatal exceptions https://bugs.python.org/issue30557
import platform
if not (sys.platform == 'win32' and
(3, 6) < sys.version_info < (3, 6, 4) and
platform.python_implementation() == 'CPython'):
faulthandler.enable()
# The version of FreeType to install locally for running the
# tests. This must match the value in `setupext.py`
LOCAL_FREETYPE_VERSION = '2.6.1'
from matplotlib import ft2font
if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
ft2font.__freetype_build_type__ != 'local'):
warnings.warn(
"Matplotlib is not built with the correct FreeType version to run "
"tests. Set local_freetype=True in setup.cfg and rebuild. "
"Expect many image comparison failures below. "
"Expected freetype version {0}. "
"Found freetype version {1}. "
"Freetype build type is {2}local".format(
LOCAL_FREETYPE_VERSION,
ft2font.__freetype_version__,
"" if ft2font.__freetype_build_type__ == 'local' else "not "
)
)
try:
import pytest
try:
from unittest import mock
except ImportError:
import mock
except ImportError:
print("matplotlib.test requires pytest and mock to run.")
raise