import io


def create_output_lines_test(expected_lines):
    """Create output test given a list of expected lines."""
    def _collate(output, addendum):
        output.write(addendum)
        return output

    def _match(output, pattern):
        return any(pattern in line for line in output.getvalue().splitlines())

    return io.BytesIO(), _collate, _match, expected_lines