[Django] #25707: Use py.test for internal testing

15 views
Skip to first unread message

Django

unread,
Nov 7, 2015, 8:29:50 PM11/7/15
to django-...@googlegroups.com
#25707: Use py.test for internal testing
-----------------------------------+--------------------
Reporter: olethanh | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------
pytest (or py.test ) offer some nice options that the current runtests.py
script does not, for example: dropping into a debugger in case of error or
a more accurate tests selection and more readable error reporting.
It also allow custom plugin and validation (e.g. pep8 and flake) and is
becoming more and more standard in the Python community so new comer could
use a tool they already know how to use.

So maybe we should discuss using it instead of the current homegrown
solution?

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

Django

unread,
Nov 7, 2015, 8:45:06 PM11/7/15
to django-...@googlegroups.com
#25707: Use py.test for internal testing
-------------------------------------+-------------------------------------

Reporter: olethanh | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by carljm):

* needs_better_patch: => 0
* stage: Unreviewed => Someday/Maybe
* needs_tests: => 0
* needs_docs: => 0


Comment:

I've certainly had the same thought; in the abstract, I don't think it
makes much sense for us to be maintaining our own test runner atop
unittest when there are well-maintained existing runners with similar
features. But unless we are ready to tell the entire Django community they
must start using py.test, the change would need to only affect internal
testing. In that case we are still maintaining a custom test runner (for
users of Django), just no longer dogfooding it ourselves. That seems like
an unfortunate situation, and not much of a win. We have a lot of test
utilities which in a pytest world ought to be rewritten as pytest
fixtures, but then they are no longer available to non-pytest users.

So I can't really see how the change practically works until/unless we are
ready to just say "the blessed way of doing all Django testing is with
py.test." I'd be ok with that in theory - I think py.test is a very good
test runner, and it could be seen as another svn/git/hg situation, where
we should just make a choice (even if controversial) rather than muddling
along with the lowest common denominator. But it would be the second
recent big breaking change to testing (1.6 DiscoverRunner being the last);
I don't want to put the community through another change like that right
now, and I don't think the support is there in the core team to do it.
(It's a bigger change in a way than svn/git/hg, since that one didn't
affect non-contributor users at all).

So, reluctantly, I have to say that despite some possible benefits, I
don't think this is likely to happen anytime soon. Moving into the
Someday/maybe category.

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

Django

unread,
Nov 25, 2015, 2:44:52 AM11/25/15
to django-...@googlegroups.com
#25707: Use py.test for internal testing
-------------------------------------+-------------------------------------

Reporter: olethanh | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by auvipy):

better to be considered for 2.0+ series.

on that occasion unittest2pytest automated converted could be a help.
[official tool]

--
Ticket URL: <https://code.djangoproject.com/ticket/25707#comment:2>

Django

unread,
Nov 25, 2015, 3:59:58 AM11/25/15
to django-...@googlegroups.com
#25707: Use py.test for internal testing
-------------------------------------+-------------------------------------

Reporter: olethanh | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by aaugustin):

We don't treat 2.0 as a special release, it's just the one that comes
after 1.10.

unittest2pytest is off-topic: the idea of this ticket isn't to change the
tests, it's to change the runner.

--
Ticket URL: <https://code.djangoproject.com/ticket/25707#comment:3>

Django

unread,
Jan 4, 2017, 7:17:57 AM1/4/17
to django-...@googlegroups.com
#25707: Use py.test for internal testing
-------------------------------------+-------------------------------------
Reporter: Olivier Le Thanh | Owner: nobody
Duong |

Type: New feature | Status: new
Component: Testing framework | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Asif Saifuddin Auvi):

* version: 1.8 => master


--
Ticket URL: <https://code.djangoproject.com/ticket/25707#comment:4>

Django

unread,
May 30, 2019, 12:58:01 PM5/30/19
to django-...@googlegroups.com
#25707: Use py.test for internal testing
-------------------------------------+-------------------------------------
Reporter: Olivier Le Thanh | Owner: nobody
Duong |
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Daniel Hahler):

For reference: I've started working on this a while ago, see
https://code.djangoproject.com/ticket/30415.
I was using a custom pytest plugin (that Django would ship itself), and
using a refactored runtests.py to re-use the same code Django uses
currently.[

--
Ticket URL: <https://code.djangoproject.com/ticket/25707#comment:5>

Django

unread,
Dec 15, 2020, 10:04:21 AM12/15/20
to django-...@googlegroups.com
#25707: Use py.test for internal testing
-------------------------------------+-------------------------------------
Reporter: Olivier Le Thanh | Owner: nobody
Duong |
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by אורי):

* cc: אורי (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/25707#comment:6>

Django

unread,
Dec 15, 2020, 11:01:36 AM12/15/20
to django-...@googlegroups.com
#25707: Use py.test for internal testing
-------------------------------------+-------------------------------------
Reporter: Olivier Le Thanh | Owner: nobody
Duong |
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Petr Přikryl):

* cc: Petr Přikryl (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/25707#comment:7>

Django

unread,
Dec 16, 2020, 3:34:47 AM12/16/20
to django-...@googlegroups.com
#25707: Use py.test for internal testing
-------------------------------------+-------------------------------------
Reporter: Olivier Le Thanh | Owner: nobody
Duong |
Type: New feature | Status: closed

Component: Testing framework | Version: master
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: new => closed
* resolution: => wontfix
* stage: Someday/Maybe => Unreviewed


Comment:

Closing as `wontfix` after [https://groups.google.com/g/django-
developers/c/3LCCRh8HgwA discussion] on the mailing list.

--
Ticket URL: <https://code.djangoproject.com/ticket/25707#comment:8>

Reply all
Reply to author
Forward
0 new messages