[Django] #34626: Documentation: "Writing your first patch for Django" - Example test file "test_make_toast.py" is not loaded by test suite

3 views
Skip to first unread message

Django

unread,
Jun 2, 2023, 8:59:30 AM6/2/23
to django-...@googlegroups.com
#34626: Documentation: "Writing your first patch for Django" - Example test file
"test_make_toast.py" is not loaded by test suite
-------------------------------------+-------------------------------------
Reporter: Lukas von | Owner: Lukas von Allmen
Allmen |
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: dev
Documentation |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
While going through the documentation for
[https://docs.djangoproject.com/en/dev/intro/contributing/#writing-some-
tests-for-your-ticket "Writing your first patch for Django - Writing a
test for ticket #99999"], I created the file "test_make_toast.py" and
after executing "./runtests.py shortcuts" the test run still succeeds. At
this point in the walkthrough the tests should file with the error message
"ImportError: cannot import name 'make_toast' from 'django.shortcuts'". It
turned out the word "test" in the file name "test_make_toast.py" must be
in plural to be loaded by the test suite: "tests_make_toast.py".

Solution:
Rename "test_make_toast.py" to "tests_make_toast.py" on this documentation
page.

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

Django

unread,
Jun 2, 2023, 9:46:57 AM6/2/23
to django-...@googlegroups.com
#34626: Documentation: "Writing your first patch for Django" - Example test file
"test_make_toast.py" is not loaded by test suite
-------------------------------------+-------------------------------------
Reporter: Lukas von Allmen | Owner: Lukas von
Type: | Allmen
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

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

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


Comment:

We have many tests files with `test_*` names and everything works fine.

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

Reply all
Reply to author
Forward
0 new messages