﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22102	Wrong test ordering	Antonis Christofides	nobody	"According to the [https://docs.djangoproject.com/en/dev/topics/testing/overview/#order-in-which-tests-are-executed 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 [https://github.com/django/django/blob/821fc925f0e384966d0b06d03fc1dd0d14cd8ec0/django/test/runner.py#L21 this]:

{{{
#!python
    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

{{{
#!python
    reorder_by = (django.test.TestCase, django.test.SimpleTestCase)
}}}"	Bug	closed	Testing framework	1.6	Normal	fixed			Ready for checkin	1	0	0	0	0	0
