﻿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
27391	Support unittest.TestCase.debug() method.	Pavel Savchenko	nobody	"== Introduction ==

The documentation for [https://docs.python.org/2/library/unittest.html#unittest.TestCase.debug unittest.TestCase.debug] states that invoking it would:

  Run the test without collecting the result. This allows exceptions raised by the test to be propagated to the caller, and can be used to support running tests under a debugger.

In essence, `debug()` invokes the test method same as [https://docs.python.org/2/library/unittest.html#unittest.TestCase.run TestCase.run()] does, without the added functionality of catching exceptions and related cruft.

== Side effects ==

A recent change in pytest (see references below) brought to our attention the fact that Django does not implement a `debug` method, and performs important stuff in `TestCase.__call__` (besides calling `run()`), such as calling `_pre_startup` and `_post_teardown` methods.

Thus, since debug() is unimplemented, running debug on a django TestCase (for example for debugging purposes), results unintended behavior, such as certain methods not being called. Most importantly `_fixture_callback` and `_fixture_teardown` which also perform database rollback (or call `flush`).

References:
https://github.com/pytest-dev/pytest/pull/1890
https://github.com/pytest-dev/pytest/issues/1932
https://github.com/pytest-dev/pytest-django/pull/406
https://github.com/python/cpython/blob/master/Lib/unittest/case.py#L651-L658
"	New feature	closed	Testing framework	dev	Normal	fixed	unittest SimpleTestCase debug	me@…	Ready for checkin	1	0	0	0	0	0
