Table of contents:
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
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.