

def pytest_collection_modifyitems(items):
    for item in items:
        if (not hasattr(item, 'module')):
            continue
        module_path = os.path.relpath(item.module.__file__, os.path.commonprefix([__file__, item.module.__file__]))
        module_root_dir = module_path.split(os.pathsep)[0]
        if module_root_dir.startswith('functional'):
            item.add_marker(pytest.mark.functional)
        elif item.startswith('unit'):
            item.add_marker(pytest.mark.unit)
        else:
            raise RuntimeError('Unknown test type (filename = {0})'.format(module_path))

dataset/ETHPy150Open pypa/warehouse/tests/conftest.py pytest_collection_modifyitems/VarMisuse@102/132 `module_root_dir`->`item`