def read_expected_errors(test):
    """ Read the expected stderr error output expected for Test
    'test', as found in the file test.errors. Returns a list of
    strings, one per line, or an empty list if the file does not
    exist. """

    try:
        errorfile = open(test.errors)
    except IOError:
        expected_error = []
    else:
        expected_error = errorfile.readlines()
        errorfile.close()
    return expected_error