test_dependencies_core.py 文件源码

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

项目:taf 作者: taf3 项目源码 文件源码
def test_import_common3_module(monkeypatch):
    """Verify that all modules can be imported within 'common3' module and 'Cross'/'Environment' objects can be created.

    """

    def fake_get_conf(env_object, path_string):
        """Get config.

        """
        return {'env': []}

    module_name = "common3"
    try:
        from testlib import common3
        common3.Cross(None, None)

        # replace Environment _get_setup method
        monkeypatch.setattr(common3.Environment, "_get_setup", fake_get_conf)
        common3.Environment(FakeOpts())
    except ImportError as err:
        pytest.fail("Import failure in '%s' module: %s" % (module_name, err))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号