steps_checker.py 文件源码

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

项目:stepler 作者: Mirantis 项目源码 文件源码
def pytest_configure(config):
    """Hook to check steps consistency."""
    if config.option.disable_steps_checker:
        config.warn('P1', 'Step consistency checker is disabled!')
        return

    errors = []
    for step_cls in _get_step_classes():
        for attr_name in dir(step_cls):

            if attr_name not in STEPS:
                continue

            step_func = six.get_unbound_function(getattr(step_cls, attr_name))
            step_func = utils.get_unwrapped_func(step_func)

            validator = StepValidator(step_func)

            errors.extend(validator.validate())
    if errors:
        pytest.exit('Some steps are not consistent!\n' + '\n'.join(errors))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号