[Django] #35114: Create a tests directory instead of tests.py when a new app is created

4 views
Skip to first unread message

Django

unread,
Jan 15, 2024, 2:01:07 AM1/15/24
to django-...@googlegroups.com
#35114: Create a tests directory instead of tests.py when a new app is created
-------------------------------------+-------------------------------------
Reporter: Salaah | Owner: Salaah Amin
Amin |
Type: | Status: assigned
Cleanup/optimization |
Component: Core | Version: dev
(Management commands) |
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 |
-------------------------------------+-------------------------------------
In every Django project I've seen, whenever a new app is created,
`tests.py` is deleted and is replaced with a `tests` directory containing
initially an `__init__.py.

I propose instead of creating a `tests.py` on app creation, create that
which is described above.

I'd be happy to take this ticket myself if it's approved.

--
Ticket URL: <https://code.djangoproject.com/ticket/35114>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 15, 2024, 2:50:08 AM1/15/24
to django-...@googlegroups.com
#35114: Create a tests directory instead of tests.py when a new app is created
-------------------------------------+-------------------------------------
Reporter: Salaah Amin | Owner: Salaah
| Amin
Type: New feature | Status: closed
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: assigned => closed
* type: Cleanup/optimization => New feature
* resolution: => wontfix


Comment:

> In every Django project I've seen...

I have a completely different experience. I've seen/created many apps
without a `tests` directory. I think that the current shape of the default
app is the right consensus and creating a `tests` directory by users is
not a big burden (if needed).

Please first start a discussion on the DevelopersMailingList, where you'll
reach a wider audience and see what other think, and
[https://docs.djangoproject.com/en/stable/internals/contributing/triaging-
tickets/#closing-tickets follow the triaging guidelines with regards to
wontfix tickets].

--
Ticket URL: <https://code.djangoproject.com/ticket/35114#comment:1>

Reply all
Reply to author
Forward
0 new messages