예제 #1
0
def pytest_funcarg__project(request):
    for crap_module in ('toimport', 'package'):
        if crap_module in sys.modules:
            del sys.modules[crap_module]

    p = Project('.')
    p.create_module = create_module.__get__(p, Project)
    p.create_scope = create_scope.__get__(p, Project)
    p.set_root = set_project_root.__get__(p, Project)
    return p
예제 #2
0
def test_stock_module(module_name):
    p = Project('./')
    m = p.get_module(module_name)

    absent_items = []
    module = sys.modules[module_name]

    for name in dir(module):
        if name not in m:
            absent_items.append((name, getattr(module, name)))

    assert absent_items == []