summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnai Zalakain <unai@gisa-elkartea.org>2013-10-02 15:27:38 +0200
committerUnai Zalakain <unai@gisa-elkartea.org>2013-11-04 01:14:24 +0100
commitcb32175bfde5733cffc45be34448b236411a589f (patch)
tree19f3373aba87cf61a8e02e09f8ee6d613ac61058
parent9b95fa7777c4b484f8053b87f48d65c853945f19 (diff)
Fixed ticket #21172
LiveServerThread.join() now behaves like threading.Thread.join(). LiveServerThread.terminate() is instead used to ask live http server to terminate and close.
-rw-r--r--django/test/testcases.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py
index fa044ba6ec..457c12f559 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -1063,12 +1063,14 @@ class LiveServerThread(threading.Thread):
self.error = e
self.is_ready.set()
- def join(self, timeout=None):
+ def terminate(self):
+ """
+ Shuts down live WSGI server.
+ """
if hasattr(self, 'httpd'):
# Stop the WSGI server
self.httpd.shutdown()
self.httpd.server_close()
- super(LiveServerThread, self).join(timeout)
class LiveServerTestCase(TransactionTestCase):
@@ -1148,6 +1150,7 @@ class LiveServerTestCase(TransactionTestCase):
# reasons has raised an exception.
if hasattr(cls, 'server_thread'):
# Terminate the live server's thread
+ cls.server_thread.terminate()
cls.server_thread.join()
# Restore sqlite connections' non-sharability