def load_test_cases():
base_path = os.path.dirname(__file__)
test_case_path = os.path.join(base_path, "test_cases")
test_case_files = os.listdir(test_case_path)
test_cases = []
for fname in test_case_files:
if not fname.endswith(".py"):
continue
fullpath = os.path.join(test_case_path, fname)
data = open(fullpath).read()
tree = ast.parse(data, fullpath)
codes, messages = extract_expected_errors(data)
test_cases.append((tree, fullpath, codes, messages))
return test_cases
评论列表
文章目录