Commit e55d6f53 authored by Denis Bilenko's avatar Denis Bilenko

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

parent c6664e72
......@@ -154,12 +154,15 @@ class TestCase(greentest.TestCase):
return self.server.socket
def _test_invalid_callback(self):
self.hook_stderr()
self.server = self.ServerClass(('127.0.0.1', 0), lambda: None)
self.server.start()
self.assert500()
self.assert_stderr_traceback('TypeError')
self.assert_stderr(self.invalid_callback_message)
try:
self.hook_stderr()
self.server = self.ServerClass(('127.0.0.1', 0), lambda: None)
self.server.start()
self.assert500()
self.assert_stderr_traceback('TypeError')
self.assert_stderr(self.invalid_callback_message)
finally:
self.server.stop()
def ServerClass(self, *args, **kwargs):
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