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))
评论列表
文章目录