Testing with Pytest

Beginner
Developer
Student
Azure

Improve your testing experience with Pytest, a great choice to write, run, and extend tests in Python. Get exposed to useful patterns and the basics of testing with Pytest.

Learning objectives

By the end of this module, you're able to:

  • Write tests using pytest, one of the most popular test frameworks for Python
  • Get used to the powerful reporting in tests failures
  • Use functions, classes, and methods for testing

Prerequisites

  • Ability to write Python scripts
  • Familiarity with command-line tools and executing scripts
  • Python 3.6 or later and a virtual environment with Pytest installed on your computer. Follow the steps in the Install Python 3 module. At the top of the article, choose the instructions for your configuration: Windows, Linux, or macOS.