Opened 2 years ago

Closed 2 years ago

#22056 closed Cleanup/optimization (fixed)

Empty directories shouldn't be included to test modules

Reported by: sebastian.pawlus@… Owned by: nobody
Component: Testing framework Version: 1.7-alpha-1
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently empty directories are included to the tests modules. It's incredibly annoying especially when switching branches and git leaves empty directories.

To reproduce just create an empty directory inside django/tests/

Change History (5)

comment:1 Changed 2 years ago by sebastian.pawlus

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 2 years ago by timo

This may be find. Personally, I use a post-checkout hook:

# Delete .pyc files and empty directories.
find . -name "*.pyc" -delete
find . -type d -empty -delete

We could at least document that if there's any drawback to the PR.

comment:3 Changed 2 years ago by AeroNotix

  • Type changed from Uncategorized to Cleanup/optimization

comment:4 Changed 2 years ago by claudep

  • Has patch set
  • Triage Stage changed from Unreviewed to Accepted

comment:5 Changed 2 years ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 4622d23ccf50a72432ff0c7416a4d6e0789c4f0b:

Fixed #22056 -- Omitted non-package directories when collecting tests

This allows us to ignore empty dirs or other unrelated dirs.
Thanks Sebastian Pawluś for the report and the initial patch.

Note: See TracTickets for help on using tickets.
Back to Top