﻿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
27255	Change test runner to display full dotted name of test	Chris Jerdonek	nobody	"At least twice in the past (#26659 and #23332), it has been suggested to change Django's test runner to display the full dotted name of tests in test output, for example:

{{{
FAIL: test_runner.test_discover_runner.DiscoverRunnerTest.test_output
}}}

instead of:

{{{
FAIL: test_output (test_runner.test_discover_runner.DiscoverRunnerTest)
}}}

The reasoning is that this is more convenient for developers: a failing test could be rerun simply by copying and pasting the test name directly from the test output, as is.

Previously, in #23332, this suggestion was closed with the following reasoning:

> Django uses the built-in unittest library of Python, and the test output is entirely handled by unittest. So there is nothing in Django which could be changed to modify this output.

However, I don't think this summary is accurate because unittest makes it very easy to change the test output (I would even say it facilitates this), for example by exposing various subclass hooks on its test runner and friends. Django indeed is [https://github.com/django/django/blob/b5aac66b28c615b2bda63548cbd695dbb5a0c381/django/test/runner.py#L541 already doing this] and modifying the test output in certain cases using `DebugSQLTextTestResult`. Django also customizes `unittest`'s test running in other ways.

The customizability of test output is also supported by the [http://bugs.python.org/issue22431#msg230957 following comment] by the author of `unittest`, Michael Foord, in response to a request that this change be made in unittest itself:

> I agree with Robert that the text output of the default runner should not be considered a part of the ""api"" that we make backwards compatible guarantees about. People who want to customise that should be customising the text runner/result.

I hope you can reconsider. I put together a patch with tests and will submit a PR shortly. You will see that the change is non-intrusive and uses the customizability exposed by unittest.
"	Uncategorized	closed	Testing framework	dev	Normal	duplicate			Unreviewed	0	0	0	0	0	0
