conftest.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:org-chart-builder 作者: Hitachi-Data-Systems 项目源码 文件源码
def pytest_runtest_setup(item):
    if isinstance(item, item.Function):
        try:
            from PIL import Image
        except ImportError:
            Image = False
        if item.get_marker("pil_required") and Image is False:
            pytest.skip("PIL must be installed")
        elif item.get_marker("pil_not_installed") and Image:
            pytest.skip("PIL is installed")
        elif item.get_marker("not_py33"):
            pytest.skip("Ordering is not a given in Python 3")
        elif item.get_marker("lxml_required"):
            from openpyxl import LXML
            if not LXML:
                pytest.skip("LXML is required for some features such as schema validation")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号