<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def readfiles():
 """ Reads test files """

    tests = list(filter(lambda x: x.endswith('.py'), os.listdir(TESTPATH)))
    tests.sort()
    files = []

    for test in tests:
        text = open(TESTPATH + test, 'r').read()

        try:
            class_, desc, cause, workaround, code = [x.rstrip() for x in \
                                                    list(filter(None, re.split(SPLIT, text)))]
            output = Output(test, class_, desc, cause, workaround, code, '', '', '')
            files.append(output)
        except IndexError:
            print('Incorrect format in file ' + TESTPATH + test)

    return files