def env_init(self, request):
"""Validate command line options.
Args:
request(pytest.request): pytest request
Returns:
testlib.common3.Environment: Environment instance
"""
if request.config.option.setup_scope not in {"session", "module", "class", "function"}:
request.config.ctlogger.error("Incorrect --setup_scope option.")
pytest.exit("Incorrect --setup_scope option.")
if request.config.option.call_check not in {"none", "complete", "fast", "sanity_check_only"}:
request.config.ctlogger.error("Incorrect --call_check option.")
pytest.exit("Incorrect --call_check option.")
if request.config.option.teardown_check not in {"none", "complete", "fast", "sanity_check_only"}:
request.config.ctlogger.error("Incorrect --teardown_check option.")
pytest.exit("Incorrect --teardown_check option.")
if request.config.option.fail_ctrl not in {"stop", "restart", "ignore"}:
request.config.ctlogger.error("Incorrect --fail_ctrl option.")
pytest.exit("Incorrect --fail_ctrl option.")
request.config.env.testenv_checkstatus = False
return request.config.env
评论列表
文章目录