def parse_conftest_error(lines):
    result = []
    lines_ = iter(lines)
    for line in lines_:
        result.append(line)
        # File location  can come first if the fixture error is a 'fixture not
        # found' error type.
        error = match_conftest_error(line)
        if error:
            result.append(
                make_error_format(
                    error.get('file_path', ""),
                    1,
                    error['error'],
                ),
            )
            break
    result.extend(lines_)
    return result
Parse conftest import error (`ConftestImportFailure`) coming from an error
dataset/ETHPy150Open okcompute/vim-python-tests-runner/compiler/runners/pytest.py/parse_conftest_error