api.py 文件源码

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

项目:pytestlab 作者: sangoma 项目源码 文件源码
def pytest_collection_modifyitems(self, session, config, items):
        env = config.getoption('--env')

        # TODO: Really naive, we need add a batch call. Until then,
        # this is going to be unworkable for anyone outside the
        # Toronto office...
        for item in items:
            for mark in self.get_marks(env=env, name=item.name):
                name = mark['name']
                args = mark.get('args', [])
                kwargs = mark.get('kwargs', {})

                pytest.log.info(
                    "Applying {} mark to {}".format(name, item.name)
                )

                mark = getattr(pytest.mark, name)(*args, **kwargs)
                item.add_marker(mark)

        # Proceed with the collection
        yield
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号