本文整理匯總了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