(dir_to_check, kind='test')
| 75 | |
| 76 | |
| 77 | def get_files(dir_to_check, kind='test'): |
| 78 | files = {} |
| 79 | patterns = { |
| 80 | 'test': f'{dir_to_check}/**/test_*.py', |
| 81 | 'stub': f'{dir_to_check}/**/*.pyi', |
| 82 | } |
| 83 | for path in glob.glob(patterns[kind], recursive=True): |
| 84 | relpath = os.path.relpath(path, dir_to_check) |
| 85 | files[relpath] = path |
| 86 | |
| 87 | # ignore python files in vendored pythoncapi-compat submodule |
| 88 | files = { |
| 89 | k: v for k, v in files.items() if 'pythoncapi-compat' not in k |
| 90 | } |
| 91 | |
| 92 | return files |
| 93 | |
| 94 | |
| 95 | if __name__ == '__main__': |