How To Install python-xmlrunner on Ubuntu 18.04

In this tutorial we learn how to install python-xmlrunner on Ubuntu 18.04. python-xmlrunner is PyUnit-based test runner with JUnit like XML reporting

Introduction

In this tutorial we learn how to install python-xmlrunner on Ubuntu 18.04.

What is python-xmlrunner

python-xmlrunner is:

unittest-xml-reporting is a Python “unittest” test runner that saves test results to machine-readble XML files that can be consumed by a wide range of development tools such as build systems, IDEs and continuous integration servers (such as Hudson/Jenkins).

It also includes an adaptor so that it can be used in conjunction with the Django web development framework.

There are three methods to install python-xmlrunner 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-xmlrunner 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-xmlrunner using apt-get by running the following command:

sudo apt-get -y install python-xmlrunner

Install python-xmlrunner Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python-xmlrunner

Install python-xmlrunner 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-xmlrunner using aptitude by running the following command:

sudo aptitude -y install python-xmlrunner

How To Uninstall python-xmlrunner on Ubuntu 18.04

To uninstall only the python-xmlrunner package we can use the following command:

sudo apt-get remove python-xmlrunner

Uninstall python-xmlrunner And Its Dependencies

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

sudo apt-get -y autoremove python-xmlrunner

Remove python-xmlrunner Configurations and Data

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

sudo apt-get -y purge python-xmlrunner

Remove python-xmlrunner configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge python-xmlrunner

References

Summary

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