pytest_selenium_pdiff.py 文件源码

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

项目:pytest-selenium-pdiff 作者: rentlytics 项目源码 文件源码
def pytest_configure(config):
    settings['SCREENSHOTS_PATH'] = config.getoption('screenshots_path')
    settings['PDIFF_PATH'] = config.getoption('pdiff_path')
    settings['ALLOW_SCREENSHOT_CAPTURE'] = config.getoption('allow_screenshot_capture')

    if 'ALLOW_SCREENSHOT_CAPTURE' in os.environ:
        settings['ALLOW_SCREENSHOT_CAPTURE'] = True

    try:
        from sh import compare
        settings['USE_IMAGEMAGICK'] = True
    except ImportError:
        pass

    try:
        from sh import perceptualdiff
        settings['USE_PERCEPTUALDIFF'] = True
    except ImportError:
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号