What? Why? Next?

What?

This module is a set of helpers to write simple and clean test for asyncio-based code.

Why?

Actually this is not nothing new, it just wraps current test approach in the handy utils. There are couple libraries that try to solve this problem. This one:

  • integrates nicely with standard unittest library,
  • is as simple as possible, without a bunch of stuff that is straithforward with unittest (eg re-inveting assertRaises with assertAsyncRaises),
  • supports both Python 3.5+ syntax and Python 3.4,
  • it’s well-documented (I think)

Among the others similar modules the best known is an extension pytest-asyncio. It provides couple extra features, but it cannot be used with unittest.TestCase (it does not support fixture injection).

Further reading: