django1/django/test
Florian Apolloner 325b03ea84 [1.6.x] Final attempt to solve sporadic test failures.
tearDownClass is not called if setUpClass throws an exception, in our case
this means that LiveServerTestCase leaks LiveServerThread sockets if the
test happens to be skipped later on, and AdminSeleniumWebDriverTestCase
doesn't close it's already open browser window. To prevent this leakage
we catch errors where needed and manually call _tearDownClassInternal.
_tearDownClassInternal should be written as defensively as possible since
it is not allowed to make any assumptions on how far setUpClass got.

This patch should fix the sporadic "Address already in use"-errors on jenkins
and also the "This code isn't under transaction management"-error for sqlite
(also just on jenkins).

After discussion with koniiiik, jezdez, kmtracey, tos9, lifeless, nedbat and
voidspace it was decided that this is the safest approach (thanks to everyone
for their comments and help). Manually calling tearDownClass was shut down
cause we don't know how our users override our classes.

This is a private and very specialized API on purpose and should not be used
without a strong reason!

This patch partially reverts the earlier attempts to fix those issues,
namely:
	2fa0dd73b1 and
	3c5775d36f

Final note: If this patch breaks in a later version of Django, please be
very careful on how you fix it, you might not see test failures locally.
That said, this patch hopefully doesn't produce even more failures.

Backport of 73a610d2a8 from master.
2013-09-17 18:36:32 +02:00
..
__init__.py Fixed #3011 -- Added swappable auth.User models. 2012-09-26 18:48:09 +08:00
_doctest.py Fixed #17365, #17366, #18727 -- Switched to discovery test runner. 2013-05-10 23:08:45 -04:00
client.py [1.6.x] Took advantage of django.utils.six.moves.urllib.*. 2013-09-10 21:29:31 +02:00
html.py Fixed spelling errors 2013-03-28 11:16:53 -06:00
runner.py [1.6.x] Fixed #20681 -- Prevented teardown_databases from attempting to tear down aliases 2013-07-13 17:46:37 -04:00
signals.py Fixed #17744 -- Reset default file storage with setting_changed signal 2012-10-30 22:23:28 +01:00
simple.py Fixed #20503 - Moved doctest utilities in with the rest of the deprecated test code. 2013-05-27 14:55:08 -06:00
testcases.py [1.6.x] Final attempt to solve sporadic test failures. 2013-09-17 18:36:32 +02:00
utils.py Fixed #20636 -- Stopped stuffing values in the settings. 2013-06-24 20:43:44 +02:00