Skip to content

Ignore directories containing only __pycache__ in test_makefile_test_folders #126014

Closed

Description

@tomasr8

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

Activity

  1. added
    type-featureA feature request or enhancement
    testsTests in the Lib/test dir
    on Oct 26, 2024
  2. self-assigned this
    on Oct 26, 2024
  3. added
    3.12only security fixes
    3.13only security fixes
    3.14bugs and security fixes
    on Oct 27, 2024
  4. added 2 commits that reference this issue on Oct 28, 2024
  5. added 2 commits that reference this issue on Oct 29, 2024
  6. added 2 commits that reference this issue on Oct 29, 2024
  7. added a commit that references this issue on Dec 8, 2024
  8. added
    type-bugAn unexpected behavior, bug, or error
    and removed
    type-featureA feature request or enhancement
    on Dec 15, 2024
  9. picnixz commented on Dec 15, 2024

    @picnixz
    Member

    Closing since completed and backported.

  10. added a commit that references this issue on Jan 12, 2025
  11. stefanor commented on Oct 22, 2025

    @stefanor
    Contributor

    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.

  12. added a commit that references this issue on Oct 22, 2025
  13. added a commit that references this issue on Jan 27, 2026
  14. added 2 commits that reference this issue on Jan 27, 2026
  15. added 2 commits that reference this issue on Jan 27, 2026
  16. added a commit that references this issue on Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.12only security fixes3.13only security fixes3.14bugs and security fixestestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions