summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-11-09 00:41:26 -0800
committerAnssi Kääriäinen <akaariai@gmail.com>2013-11-09 00:41:26 -0800
commit1830f50493cae042dac11957af986b0fd84f889f (patch)
tree79e437767d7e3b24fdabeed450e7c516a8d32c3f
parenta8e84521c4e413ab1c50edd94ebd8a4724b6a851 (diff)
parentcb32175bfde5733cffc45be34448b236411a589f (diff)
Merge pull request #1743 from unaizalakain/ticket_21172
Fixed #21172 -- have LiveServerThread follow the semantics of threading.Thread.join()
-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 2ca82d7536..d2c1735763 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -1068,12 +1068,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):
@@ -1153,6 +1155,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