How To Install python-coverage-test-runner on Ubuntu 18.04

In this tutorial we learn how to install python-coverage-test-runner on Ubuntu 18.04. python-coverage-test-runner is fail Python program unit tests unless they test everything

Introduction

In this tutorial we learn how to install python-coverage-test-runner on Ubuntu 18.04.

What is python-coverage-test-runner

python-coverage-test-runner is:

This package contains the Python module CoverageTestRunner, which runs unit tests implemented using the unittest module in the Python standard library. It runs them using coverage.py (in the python-coverage package) and fails the test if all statements are not covered.

There are three methods to install python-coverage-test-runner on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python-coverage-test-runner Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python-coverage-test-runner using apt-get by running the following command:

sudo apt-get -y install python-coverage-test-runner

Install python-coverage-test-runner Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python-coverage-test-runner using apt by running the following command:

sudo apt -y install python-coverage-test-runner

Install python-coverage-test-runner Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python-coverage-test-runner using aptitude by running the following command:

sudo aptitude -y install python-coverage-test-runner

How To Uninstall python-coverage-test-runner on Ubuntu 18.04

To uninstall only the python-coverage-test-runner package we can use the following command:

sudo apt-get remove python-coverage-test-runner

Uninstall python-coverage-test-runner And Its Dependencies

To uninstall python-coverage-test-runner and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove python-coverage-test-runner

Remove python-coverage-test-runner Configurations and Data

To remove python-coverage-test-runner configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge python-coverage-test-runner

Remove python-coverage-test-runner configuration, data, and all of its dependencies

We can use the following command to remove python-coverage-test-runner configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python-coverage-test-runner

References

Summary

In this tutorial we learn how to install python-coverage-test-runner package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.