def test_client_server_client_timeout_with_async():
    endpoint = random_ipc_endpoint()

    class MySrv(zerorpc.Server):

        def lolita(self):
            return 42

        def add(self, a, b):
            gevent.sleep(TIME_FACTOR * 10)
            return a + b

    srv = MySrv()
    srv.bind(endpoint)
    gevent.spawn(srv.run)

    client = zerorpc.Client(timeout=TIME_FACTOR * 2)
    client.connect(endpoint)

    async_result = client.add(1, 4, async=True)

    if (2, 7) < sys.version_info:
        def _do_with_assert_raises():
            print async_result.get()
        assert_raises(zerorpc.TimeoutExpired, _do_with_assert_raises)
    else:
        with assert_raises(zerorpc.TimeoutExpired):
            print async_result.get()
    client.close()
    srv.close()
dataset/ETHPy150Open 0rpc/zerorpc-python/tests/test_client_async.py/test_client_server_client_timeout_with_async/swapped operands of `<`