Skip to content
Merged
Changes from 2 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
Comment on lines 51 to 52
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is just redundant.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Skipping empty dirs is a part of the plan.
Without these lines: mkdir Lib/test/test_empty

Will produce: AssertionError: 'test/test_empty' not found in [...]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not the following check cover this case?

>>> files= []
>>> all(filename.startswith('.') for filename in files)
True

# Skip dirs with hidden-only files:
if not dirs and all(filename.startswith('.') for filename in files):
Comment thread
furkanonder marked this conversation as resolved.
Outdated
continue

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