def assert_has_n_lines(output, n):
    """Asserts the specified output contains ``n`` lines."""
    n_lines_found = len(output.splitlines())
    assert n_lines_found == int(n
        ), 'Expected %s lines in output, found %s lines' % (n, n_lines_found)
