test_functional.py 文件源码

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

项目:shopify_python 作者: Shopify 项目源码 文件源码
def setUp(self):
        if self._should_be_skipped_due_to_version():
            pytest.skip('Test cannot run with Python %s.' % (sys.version.split(' ')[0],))
        missing = []
        for req in self._test_file.options['requires']:
            try:
                __import__(req)
            except ImportError:
                missing.append(req)
        if missing:
            pytest.skip('Requires %s to be present.' % (','.join(missing),))
        if self._test_file.options['except_implementations']:
            implementations = [
                item.strip() for item in
                self._test_file.options['except_implementations'].split(",")
            ]
            implementation = platform.python_implementation()
            if implementation in implementations:
                pytest.skip(
                    'Test cannot run with Python implementation %r'
                    % (implementation, ))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号