test_flake8_linter.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:gql 作者: graphql-python 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号