Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit cb32175bfde5733cffc45be34448b236411a589f 1 parent 9b95fa7
@unaizalakain unaizalakain authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 django/test/testcases.py
View
7 django/test/testcases.py
@@ -1063,12 +1063,14 @@ def run(self):
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 @@ def _tearDownClassInternal(cls):
# 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

0 comments on commit cb32175

Please sign in to comment.
Something went wrong with that request. Please try again.