Closed
Labels
3.12only security fixesonly security fixes3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixestestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Feature or enhancement
Proposal:
While working on some tests, sometimes when switching branches I have a leftover __pycache__ directory in an otherwise empty test folder. This can happen for example when converting a test file into its own directory.
test_makefile_test_folders already ignores empty folders and __pycache__ folders separately. I think it'd be nice if it also ignored folders which only contain __pycache__.
cc @sobolevn since you added this test originally :)
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
- gh-126014: Ignore
__pycache__-only folders in makefile tests #126066 - [3.13] gh-126014: Ignore
__pycache__-only folders in makefile tests (GH-126066) #126109 - [3.12] gh-126014: Ignore
__pycache__-only folders in makefile tests (GH-126066) #126110 - gh-126014: test_makefile_test_folders: Ignore basically-empty directories #140466
- [3.13] gh-126014: test_makefile_test_folders: Ignore basically-empty directories (GH-140466) #144268
- [3.14] gh-126014: test_makefile_test_folders: Ignore basically-empty directories (GH-140466) #144269
Reacted by Serhiy Storchaka
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixestestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
pythongh-126014: Ignore `__pycache__`-only folders in makefile tests
gh-126014: Ignore `__pycache__`-only folders in makefile tests (#126066)
pythongh-126014: Ignore `__pycache__`-only folders in makefile tests (p…
pythongh-126014: Ignore `__pycache__`-only folders in makefile tests (p…
[3.12] gh-126014: Ignore `__pycache__`-only folders in makefile tests (…
[3.13] gh-126014: Ignore `__pycache__`-only folders in makefile tests (…
pythongh-126014: Ignore `__pycache__`-only folders in makefile tests (p…
picnixz commentedon Dec 15, 2024
Closing since completed and backported.
pythongh-126014: Ignore `__pycache__`-only folders in makefile tests (p…
stefanor commentedon Oct 22, 2025
There's a variant of this bug where a directory containing only a single
__pycache__is not included. I've run into this while bisecting across large swathes of history, which leave empty directories around.pythongh-126014: test_makefile_test_folders: Ignore basically-empty d…
gh-126014: test_makefile_test_folders: Ignore basically-empty directo…
pythongh-126014: test_makefile_test_folders: Ignore basically-empty d…
pythongh-126014: test_makefile_test_folders: Ignore basically-empty d…
[3.13] gh-126014: test_makefile_test_folders: Ignore basically-empty …
[3.14] gh-126014: test_makefile_test_folders: Ignore basically-empty …
pythongh-126014: test_makefile_test_folders: Ignore basically-empty d…