GitHub - Martiusweb/asynctest: Enhance the standard unittest package with features for testing asyncio libraries (original) (raw)

PyPI Travis AppVeyor Supported Python versions Supported Python implementations

asynctest

The package asynctest is built on top of the standard unittest module and cuts down boilerplate code when testing libraries for asyncio.

Currently, asynctest targets the "selector" model, hence, some features will not (yet?) work with Windows' proactor.

⚠️ Warning: changes in 0.13

Since asynctest 0.13, some major changes may impact you:

Author & license

Authored by Martin Richard <martius@martiusweb.net> and licensed under the Apache 2 license.

Copyright 2019 Martin Richard

In addition, permission is explicitly granted to Python contributors to use, copy, modify, (...) the code and documentation of asynctest for any project of the Python Software Foundation. This gives the PSF the irrevocable and perpetual rights that the PSD claims in its CLA.

This means that by contributing to asynctest, you agree that these contributions may be included in any project of the Python Software Foundation, and can be subject to re-licensing under the Python Software License.

See the AUTHORS file for a comprehensive list of the authors.

Documentation

https://readthedocs.org/projects/asynctest/badge/

Full documentation is available at http://asynctest.readthedocs.org/en/latest/. It includes a tutorial with tested examples of how to use TestCase or mocks.

Features

TestCases

Mock and CoroutineMock

Selectors

The module asynctest.selector provides classes to mock objects performing IO (files, sockets, etc).

Helpers

Roadmap

I hope I will find time to develop and release the following features:

Tests

asynctest is unit tested. You can run asynctest test suite with this command:

$ PYTHONPATH=. python -m unittest test