Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 835 Bytes

chapter-21.3-pytest.md

File metadata and controls

30 lines (20 loc) · 835 Bytes

Chapter 21.3: The pytest Package

Table of contents:

The pytest package.

Pytest is a testing framework which is made to simplify tests. It allows us to test our programs with the help of functional programming technique.

Some of the interesting features of pytest are as follows:

  • Auto discovery of test modules and functions
  • Fixtures to reduce repetitions in test codes
  • Plugins can be introduced to enhance testing experience

Installing pytest

To install pytest, we need to install it using package manager of our choice. For example, we could use pip, poetry, etc. to install pytest package.

# using pip
pip install pytest

# using poetry
poetry add pytest

To know more about pytest, you can read the detailed pytest documentation here.