pytest

A popular Python testing framework that finds test functions automatically and reports failures with detailed comparisons.

In more detail

Tests are plain functions whose names start with test_, in files named like test_*.py, using ordinary assert statements, with no base class or registration needed. Running pytest discovers and runs them all, and it rewrites assert statements so failures show the values involved. It also adds fixtures, markers and parametrization, and is a third-party package installed with pip.

Examples

python -m pip install pytest
pytest -q
pytest -q test_cart.py

Related terms

Taught in

References

Certification courses