Skip to content

Commit

Permalink
pythongh-117166: Ignore empty and temporary dirs in test_makefile (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Mar 29, 2024
1 parent 35b6c4a commit d9cfe7e
Showing 1 changed file with 10 additions and 2 deletions.
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

0 comments on commit d9cfe7e

Please sign in to comment.