Info messages in python unit testing
I am using Python module unittest
for unit testing.
I would like to be able to report informational messages as part of a unit test output other than a transfer / failure state. Specifically, in my case, I want to let you know if the module under test is using a pure Python implementation or a C extension.
Is there a mechanism unittest
for displaying informational messages as part of the test report? Can this be done in Python unit test alternate frames?
a source to share
Yes, you can use nosetests , which has a plugin system that allows this. For example, the TestResult api allows you to provide advanced reports:
Provides a TextTestResult that extends unittests _TextTestResult to provide support for error classes (such as inline skips and deprecated classes) and hooks for plugins to capture or extend reporting.
a source to share