8000 gh-117166: Ignore empty and temporary dirs in `test_makefile` by sobolevn · Pull Request #117190 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

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

Merged
merged 4 commits into from
Mar 29, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Address review
  • Loading branch information
sobolevn committed Mar 29, 2024
commit 15d57b29da7049e1049941c3be93cbdeffc14684
2 changes: 1 addition & 1 deletion Lib/test/test_tools/test_makefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_makefile_test_folders(self):
if not dirs and not files:
continue
Copy link
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
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
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 fi
5FA9
lename in files)
True

# Skip dirs with hidden-only files:
if not dirs and all(filename.startswith('.') for filename in files):
if all(filename.startswith('.') for filename in files):
continue

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