Commit 537ff288 authored by Denis Bilenko's avatar Denis Bilenko

test__server.py: do not leak a server from the test case

--HG--
extra : transplant_source : %C7%92p%D1%01%9A%60%B4%A7%AB%40%C7%DB%DF%7Cn%0B%96%8D%CF
parent e2b7c784
...@@ -154,12 +154,15 @@ class TestCase(greentest.TestCase): ...@@ -154,12 +154,15 @@ class TestCase(greentest.TestCase):
return self.server.socket return self.server.socket
def _test_invalid_callback(self): def _test_invalid_callback(self):
self.hook_stderr() try:
self.server = self.ServerClass(('127.0.0.1', 0), lambda: None) self.hook_stderr()
self.server.start() self.server = self.ServerClass(('127.0.0.1', 0), lambda: None)
self.assert500() self.server.start()
self.assert_stderr_traceback('TypeError') self.assert500()
self.assert_stderr(self.invalid_callback_message) self.assert_stderr_traceback('TypeError')
self.assert_stderr(self.invalid_callback_message)
finally:
self.server.stop()
def ServerClass(self, *args, **kwargs): def ServerClass(self, *args, **kwargs):
kwargs.setdefault('spawn', self.get_spawn()) kwargs.setdefault('spawn', self.get_spawn())
......
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