def read_expected_output(test):
    """ Read the expected stdout output expected for Test 'test',
    from the file test.output. Returns a list of strings, one per
    line, or an empty list if the file does not exist. """

    try:
        outputfile = open(test.output)
    except IOError:
        expected_output = []
    else:
        expected_output = outputfile.readlines()
        outputfile.close()
    return expected_output