pytest_onsenv.py 文件源码

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

项目:taf 作者: taf3 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号