Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-117166: Ignore empty and temporary dirs in test_makefile #117190

Merged
merged 4 commits into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Lib/test/test_tools/test_makefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,17 @@ def test_makefile_test_folders(self):
self.assertIn(idle_test, test_dirs)

used = [idle_test]
for dirpath, _, _ in os.walk(support.TEST_HOME_DIR):
for dirpath, dirs, files in os.walk(support.TEST_HOME_DIR):
dirname = os.path.basename(dirpath)
if dirname == '__pycache__':
# Skip temporary dirs:
if dirname == '__pycache__' or dirname.startswith('.'):
dirs.clear() # do not process subfolders
continue
# Skip empty dirs:
if not dirs and not files:
continue
# Skip dirs with hidden-only files:
if files and all(filename.startswith('.') for filename in files):
continue

relpath = os.path.relpath(dirpath, support.STDLIB_DIR)
Expand Down
Loading