diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-05-20 16:35:58 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-05-20 16:35:58 (GMT) |
commit | 2177ac9c41ff97fde0f398b878b5d84528f0c9f1 (patch) | |
tree | 765e6d053f22d9523825f696fd8392a3d5ae0b1a | |
parent | 6071359de177ba2db621ff698fb4e7c4e1287294 (diff) | |
download | cpython-2177ac9c41ff97fde0f398b878b5d84528f0c9f1.zip cpython-2177ac9c41ff97fde0f398b878b5d84528f0c9f1.tar.gz cpython-2177ac9c41ff97fde0f398b878b5d84528f0c9f1.tar.bz2 |
Fix more ResourceWarnings in test_packaging moving the join() and server_close() in the stop method.
-rw-r--r-- | Lib/packaging/tests/pypi_server.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/packaging/tests/pypi_server.py b/Lib/packaging/tests/pypi_server.py index 1e4b012..d22f5c3 100644 --- a/Lib/packaging/tests/pypi_server.py +++ b/Lib/packaging/tests/pypi_server.py @@ -78,12 +78,7 @@ class PyPIServerTestCase(unittest.TestCase): super(PyPIServerTestCase, self).setUp() self.pypi = PyPIServer() self.pypi.start() - - def tearDown(self): - super(PyPIServerTestCase, self).tearDown() - self.pypi.stop() - self.pypi.join() - self.pypi.server.server_close() + self.addCleanup(self.pypi.stop) class PyPIServer(threading.Thread): @@ -154,6 +149,8 @@ class PyPIServer(threading.Thread): def stop(self): """self shutdown is not supported for python < 2.6""" self._run = False + self.join() + self.server.server_close() def get_next_response(self): return (self.default_response_status, |