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")
conftest.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录