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 (pytest-freezegun).

Pytest HTML

The plugin we are going to cover here is the pytest-html plugin. As the name suggests, pytest-html:

generates HTML reports of your test runs.

Installation

To install 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.

Ready to Master Network Automation? Start Your Journey Today!
Our membership provides:
  • Full deep-dive course library (inc. Batfish, pyATS, Netmiko)
  • Code repositories inc. full course code, scripts and examples
  • 24x7 multi-vendor labs (Arista, Cisco, Juniper)
  • Private online community
  • Live monthly tech sessions
  • Access to tech session library

Join Now ➜
Close You've successfully subscribed to Packet Coders.
Close Success! Your account is fully activated, you now have access to all content.
Close Welcome back! You've successfully signed in.
Close Nearly there! To activate your account, please click the link in the email we just sent you.