[Django] #35695: Running tests leaves empty unused directory behind

8 views
Skip to first unread message

Django

unread,
Aug 20, 2024, 8:58:52 AM8/20/24
to django-...@googlegroups.com
#35695: Running tests leaves empty unused directory behind
-------------------------------------+-------------------------------------
Reporter: Hisham | Owner: Hisham Mahmood
Mahmood |
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: dev
Uncategorized |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Running `./runtests.py
model_fields.test_filefield.FileFieldTests.test_delete_content_file`
actually creates a file on disk and then deletes it leaving an empty
`unused/` directory behind. No other tests in
`model_fields.test_filefield.FileFieldTests` create any files on disk.

I suggest that we move this to a temporary folder like done in
https://github.com/django/django/pull/18396 but for `model_fields` instead
of `model_forms`
--
Ticket URL: <https://code.djangoproject.com/ticket/35695>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 20, 2024, 9:01:23 AM8/20/24
to django-...@googlegroups.com
#35695: Running tests leaves empty unused directory behind
-------------------------------------+-------------------------------------
Reporter: Hisham Mahmood | Owner: Hisham
Type: | Mahmood
Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hisham Mahmood):

* has_patch: 0 => 1

Comment:

[https://github.com/django/django/pull/18400 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/35695#comment:1>

Django

unread,
Aug 20, 2024, 9:35:28 AM8/20/24
to django-...@googlegroups.com
#35695: Running tests leaves empty unused directory behind
-------------------------------------+-------------------------------------
Reporter: Hisham Mahmood | Owner: Hisham
Type: | Mahmood
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* component: Uncategorized => Testing framework
* stage: Unreviewed => Ready for checkin

Comment:

Thanks for noticing!
--
Ticket URL: <https://code.djangoproject.com/ticket/35695#comment:2>

Django

unread,
Aug 21, 2024, 7:51:36 AM8/21/24
to django-...@googlegroups.com
#35695: Running tests leaves empty unused directory behind
-------------------------------------+-------------------------------------
Reporter: Hisham Mahmood | Owner: Hisham
Type: | Mahmood
Cleanup/optimization | Status: closed
Component: Testing framework | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"519087819ed6e8bfbe6be208df71a7df19f23a58" 51908781]:
{{{#!CommitTicketReference repository=""
revision="519087819ed6e8bfbe6be208df71a7df19f23a58"
Fixed #35695 -- Ensured FileFields use a storage pointing to a temp
directory in model_fields tests.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35695#comment:3>
Reply all
Reply to author
Forward
0 new messages