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 should be 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.13 or later and a virtual environment with Pytest installed on your computer. Follow the steps in Python 3.13.3 module. Choose the installer for your configuration: Windows, Linux, or macOS.

Get started with Azure

Choose the Azure account that's right for you. Pay as you go or try Azure free for up to 30 days. Sign up.