Commit 2177ac9c authored by Ezio Melotti's avatar Ezio Melotti

Fix more ResourceWarnings in test_packaging moving the join() and...

Fix more ResourceWarnings in test_packaging moving the join() and server_close() in the stop method.
parent 6071359d
...@@ -78,12 +78,7 @@ class PyPIServerTestCase(unittest.TestCase): ...@@ -78,12 +78,7 @@ class PyPIServerTestCase(unittest.TestCase):
super(PyPIServerTestCase, self).setUp() super(PyPIServerTestCase, self).setUp()
self.pypi = PyPIServer() self.pypi = PyPIServer()
self.pypi.start() self.pypi.start()
self.addCleanup(self.pypi.stop)
def tearDown(self):
super(PyPIServerTestCase, self).tearDown()
self.pypi.stop()
self.pypi.join()
self.pypi.server.server_close()
class PyPIServer(threading.Thread): class PyPIServer(threading.Thread):
...@@ -154,6 +149,8 @@ class PyPIServer(threading.Thread): ...@@ -154,6 +149,8 @@ class PyPIServer(threading.Thread):
def stop(self): def stop(self):
"""self shutdown is not supported for python < 2.6""" """self shutdown is not supported for python < 2.6"""
self._run = False self._run = False
self.join()
self.server.server_close()
def get_next_response(self): def get_next_response(self):
return (self.default_response_status, return (self.default_response_status,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment