Pytest - Environment Setup



In this chapter, we will learn how to install pytest.

Installing Latest Version

To install the latest version of pytest, execute the following command −

pip install pytest

Installing a specific version

We can install any version of pytest using following syntax.

pip3 install pytest == 9.0.2

Verify the installation

Confirm the installation using the following command to display the help section of pytest.

pytest --version
pytest 9.0.2
Advertisements