def server(): server = Server(9090) server_thread = threading.Thread(target=server.start) server_thread.start() yield server.stop() server_thread.join()
def main(): server = Server(9090) server_thread = threading.Thread(target=server.start) server_thread.start() client = Client(9090) client.put('foo', 'bar') client.get('foo') client.get('baz') server.stop() server_thread.join()