Yury Selivanov added the comment: I think that the main problem is that '_stop_server' is called from a main thread (by unittest machinery via addCleanup), whereas the loop is in the other thread. asyncio code is not thread-safe in general.
If I change your code slightly to avoid using addCleanup, then everything works: https://gist.github.com/1st1/8dd0a2d4aa1ffd895c52 FWIW I couldn't reproduce the "NoneType object is not iterable" error. On my machine with python3.4.1 it crashes with another error "AssertionError: server did not stop" on line 35. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22572> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com