python-zulip-api icon indicating copy to clipboard operation
python-zulip-api copied to clipboard

[WIP] Add async option for bots

Open neiljp opened this issue 6 years ago • 1 comments

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).

neiljp avatar May 25 '18 03:05 neiljp

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.

zulipbot avatar Jun 02 '18 17:06 zulipbot