Integrating Avocado

Testing software is important, but knowing the effectiveness of the tests, like which parts are being exercised by the tests, may help develop new tests. is a tool designed for measuring code coverage of Python programs. It runs monitoring the program’s source, taking notes of which parts of the code have been executed.

It is possible to use while running Avocado Instrumented tests. As Avocado spawn sub-processes to run the tests, the concurrency parameter should be set to multiprocessing.

To make the parameters visible to other processes spawned by Avocado, create the .coveragerc file in the project’s root folder. Following is an example:

concurrency = multiprocessing
source = foo/bar
parallel = true

According to the documentation of, when measuring coverage in a multi-process program, setting the parallel parameter will keep the data separate during the measurement.

With the .coveragerc file set, one possible workflow to use to measure Avocado tests is:

coverage run -m avocado run tests/foo
coverage combine
coverage report

The first command uses to measure the code coverage of the Avocado tests. Then, coverage combine combines all measurement files to a single .coverage data file. The coverage report shows the report of the coverage measurement.

For other options related to, visit the software documentation.