If @pytest.mark.asyncio decorator is used for test methods, the event loop of
pytest-asyncio is set as the default asyncio event loop automatically.
ZKClient was initiated without the loop argument and was called while not
inside the @pytest.mark.asyncio decorator, so it uses the default asyncio event
loop.
Hence, plenty of tests complained that "Future attached to a different loop".
To solve this problem, make ZKClient use event_loop generated by pytest-asyncio
instead of default asyncio event loop.
If @pytest.mark.asyncio decorator is used for test methods, the event loop of pytest-asyncio is set as the default asyncio event loop automatically.
ZKClient was initiated without the loop argument and was called while not inside the @pytest.mark.asyncio decorator, so it uses the default asyncio event loop.
Hence, plenty of tests complained that "Future attached to a different loop".
To solve this problem, make ZKClient use event_loop generated by pytest-asyncio instead of default asyncio event loop.