[Django] #18727: Remove django.test._doctest

7 views
Skip to first unread message

Django

unread,
Aug 6, 2012, 4:52:45 PM8/6/12
to django-...@googlegroups.com
#18727: Remove django.test._doctest
------------------------------------------------+------------------------
Reporter: aaugustin | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
We have copied this module from the standard library and submitted the
patch to Python's bug tracker six years ago:
http://bugs.python.org/issue1521051

Patching our copy to support both Python 2 and 3 increases severely the
amount of changes from Python's version. It becomes much harder to apply
upstream changes.

Unfortunately the ticket is stuck, because the patch we provided didn't
include tests. Even if tests were added and the patch was committed now,
we'd have to deprecate all Pythons <= 3.3 before removing our copy and
relying on the stdlib. This isn't going to happen in the next five years.

Since Django moved away from using doctests, and as suggested by Russell
two years ago in the tickets comments, we should deprecate our copy.

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

Django

unread,
Aug 6, 2012, 5:00:27 PM8/6/12
to django-...@googlegroups.com
#18727: Remove django.test._doctest
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Testing framework | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by aaugustin:

Old description:

> We have copied this module from the standard library and submitted the
> patch to Python's bug tracker six years ago:
> http://bugs.python.org/issue1521051
>
> Patching our copy to support both Python 2 and 3 increases severely the
> amount of changes from Python's version. It becomes much harder to apply
> upstream changes.
>
> Unfortunately the ticket is stuck, because the patch we provided didn't
> include tests. Even if tests were added and the patch was committed now,
> we'd have to deprecate all Pythons <= 3.3 before removing our copy and
> relying on the stdlib. This isn't going to happen in the next five years.
>
> Since Django moved away from using doctests, and as suggested by Russell
> two years ago in the tickets comments, we should deprecate our copy.

New description:

We have copied this module from the standard library and submitted the
patch to Python's bug tracker six years ago:
http://bugs.python.org/issue1521051

Unfortunately the ticket is stuck because the patch didn't include tests.
Even if tests were added and the patch was committed now, we'd have to
deprecate all Pythons <= 3.3 before removing our copy and relying on the
stdlib. This isn't going to happen in the next five years.

Patching our copy to support both Python 2 and 3 increases severely the
amount of changes from Python's version. It becomes much harder to apply
upstream changes. We could copy both the version from 2.7 and the version
from 3.2, apply the patch to both, and import the right one, but that adds
complexity.

I think we'd better deprecate our copy:
- doctests aren't a suitable tool for testing Django apps (IMO),
- we moved away from using doctests in Django's test suite,
- Russell suggested it two years ago in the tickets comments.

--

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

Django

unread,
Aug 6, 2012, 8:43:06 PM8/6/12
to django-...@googlegroups.com
#18727: Remove django.test._doctest
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Testing framework | Resolution:
Severity: Normal | Triage Stage: Design
Keywords: | decision needed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by russellm):

* stage: Unreviewed => Design decision needed


Comment:

I'm the author of that ticket, and the person responsible for there being
no tests. If I'd finished the job in 2006, it would have been a non-issue,
but as it is, we have a headache.

However, we need to be clear about what it is we'd be deprecating -- it's
not just removing our copy of doctests, we'd be deprecating '''the ability
for Django's test runner to identify and include doctests'''. The reason
the modified doctest package exists is for integration with our test
runner; if we remove the duplicate package, we lose the features we need
to integrate with the test runner.

Since the doctest-ocalypse, this isn't an issue for Django itself;
however, I can imagine that it may be problematic for some users.

Personally, I have no problems killing doctests in this way. I'm sure
others share my enthusiasm. I'm also sure that some do not.

Another way to tackle this problem -- make it part of #17365. If we change
our test discovery mechanism to be something standardized, we can fall
back on the standardized behaviour, which won't include doctests by
default.

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

Django

unread,
Mar 17, 2013, 6:08:51 PM3/17/13
to django-...@googlegroups.com
#18727: Remove django.test._doctest
--------------------------------------+------------------------------------

Reporter: aaugustin | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by aaugustin):

* stage: Design decision needed => Accepted


Comment:

Let's do this with #17365 then.

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

Django

unread,
May 10, 2013, 11:12:23 PM5/10/13
to django-...@googlegroups.com
#18727: Remove django.test._doctest
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: nobody
Type: Cleanup/optimization | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Carl Meyer <carl@…>):

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


Comment:

In [changeset:"9012833af857e081b515ce760685b157638efcef"]:
{{{
#!CommitTicketReference repository=""
revision="9012833af857e081b515ce760685b157638efcef"
Fixed #17365, #17366, #18727 -- Switched to discovery test runner.

Thanks to Preston Timmons for the bulk of the work on the patch,
especially
updating Django's own test suite to comply with the requirements of the
new
runner. Thanks also to Jannis Leidel and Mahdi Yusuf for earlier work on
the
patch and the discovery runner.

Refs #11077, #17032, and #18670.
}}}

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

Django

unread,
May 10, 2013, 11:13:51 PM5/10/13
to django-...@googlegroups.com
#18727: Remove django.test._doctest
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: nobody
Type: Cleanup/optimization | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by carljm):

Closing this ticket, as `django.test._doctest` has now been deprecated and
will be removed on the normal deprecation schedule.

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

Django

unread,
May 11, 2013, 9:48:44 AM5/11/13
to django-...@googlegroups.com
#18727: Remove django.test._doctest
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: nobody
Type: Cleanup/optimization | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Florian Apolloner <florian@…>):

In [changeset:"e23a5f9a4730ddecb8f3950ee2936716f458c506"]:
{{{
#!CommitTicketReference repository=""
revision="e23a5f9a4730ddecb8f3950ee2936716f458c506"
Fixed a regression in the test runner loading of runtests.py.

Refs #17365, #17366, #18727.
}}}

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

Django

unread,
May 11, 2013, 12:30:15 PM5/11/13
to django-...@googlegroups.com
#18727: Remove django.test._doctest
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: nobody
Type: Cleanup/optimization | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Florian Apolloner <florian@…>):

In [changeset:"2bf403ecbd958bfb269794b36e61b69f0aede4cf"]:
{{{
#!CommitTicketReference repository=""
revision="2bf403ecbd958bfb269794b36e61b69f0aede4cf"
Fixed a regression from e23a5f9a4730ddecb8f3950ee2936716f458c506.

Excluded postgis specific gis tests from other spatial databases.

Refs #17365, #17366, #18727.
}}}

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

Django

unread,
Mar 21, 2014, 1:37:14 PM3/21/14
to django-...@googlegroups.com
#18727: Remove django.test._doctest
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: nobody
Type: Cleanup/optimization | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"bf5430a20b65b3e76a2f8cd2580101e0baa59f82"]:
{{{
#!CommitTicketReference repository=""
revision="bf5430a20b65b3e76a2f8cd2580101e0baa59f82"
Removed django.test.simple and django.test._doctest per deprecation
timeline.

refs #17365, #17366, #18727.
}}}

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

Reply all
Reply to author
Forward
0 new messages