In this lesson, you will learn:
- Benefits of Pytest plugins.
- How to use the Pytest HTML plugin to generate HTML reports.
Introduction to Pytest Plugins
The Pytest ecosystem provides various plugins that can easily be installed to enhance the behaviour and/or output of Pytest. These range from plugins to enhance the output of the Pytest results (
pytest-clarity) to plugins to allow you deal with time and date objects within your tests (
The plugin we are going to cover here is the
pytest-html plugin. As the name suggests,
generates HTML reports of your test runs.
pytest-html all that is required is a simple pip install, like so:
pip install pytest-html==3.1.1
Note: If you have already performed the lab installation steps back in the previous chapter, this will already be installed within your environment.