...

/

Introduction to pytest

Introduction to pytest

Learn how to write tests using pytest.

Overview

To start our journey, we’ll only need a single new tool—pytest. It is not part of Python’s standard library; however, it’s the most helpful tool for testing Python code.

pytest is a testing framework for Python that makes it easy to write and run tests. It allows you to use plain Python code and has automatic test discovery and execution in your project. It also provides useful features such as the built-in assert statement and ...