Wrong test ordering
According to the documentation, the order of test execution is first (1) django.test.TestCase
subclasses, then (2) "all other unittests (including unittest.TestCase
, ...)", then (3) doctests. However, doctest.DocTestCase
is a subclass of unittest.TestCase
. Therefore the documentation is inaccurate: it implies that doctests do not descend from unittest.TestCase
.
The django.test.runner
has this:
reorder_by = (TestCase, )
where TestCase
is actually django.test.TestCase
. Therefore, in contrast to the documentation, no other unittest.TestCase
subclasses seem to be taken into account. Indeed, I'm debugging an application in which some doctests insist running before some LiveServerTestCase
tests; the problem goes away if I use a django.test.runner.DiscoverRunner
subclass that has
reorder_by = (django.test.TestCase, django.test.SimpleTestCase)
Change History
(5)
Triage Stage: |
Unreviewed → Accepted
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Pull request: https://github.com/django/django/pull/2519