python-zulip-api
python-zulip-api copied to clipboard
[WIP] Add async option for bots
This breaks the async
support out of #390, aiming to add compatibility with python 3.4 and tests.
This is currently WIP since:
- some commits could be squashed together, notably the first 3 together
- tests currently break on coverage, since the last commit doesn't appear to remove
lib_tests.py
from the coverage (which otherwise breaks for python 3.4 when examining the test code) - the tests might be able to be refactored, and the comments standardised ;)
Tests can finish smoothly with the new shut_down_message_handler_for_bot
, but I just noticed they (locally) generate the following, which they did not before:
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending coro=<CoroutineMock._mock_call.<locals>.proxy() running at /home/neil/repos/python-zulip-api/zulip-api-py3-venv/lib/python3.5/site-packages/asynctest/mock.py:545> cb=[_chain_future.<locals>._call_set_state() at /usr/lib/python3.5/asyncio/futures.py:459]>
This is resolved through the last commit, including modifying the test so it more reliably triggers it (though the reason for this isn't completely clear).
Heads up @neiljp, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master
branch and resolve your pull request's merge conflicts accordingly.