Although the Python standard library comes with a unit testing framework called ùnittest, pytest is the go-to testing framework for testing Python code.
https://docs.pytest.org/en/latest/
Let's see how to use it
https://docs.pytest.org/en/latest/
Let's see how to use it


1. Install it via pip - "pip install pytest"
2. Creta a new file "simple_test.py" containing code from the image
3. Run it - "pytest simple_test.py"

It makes sense to use that when you want to wrap the test setup or complex assertions inside methods to make tests more readable

pytest.ini - configuration for pytest
http://conftest.py - contains fixtures
tests - contains all tests
sum - package with production code (there can be multiple ones)

They are so great that they have their own thread: https://twitter.com/jangiacomelli/status/1343849489379909633?s=20

- pattern for searching test files
- pytest markers
- settings for plugins

- pytest.mark.parametrize decorator
The same test will run for multiple different inputs

- pytest-django - provides a set of tools made specifically for testing Django applications
- pytest-xdist - is used to run tests in parallel
- pytest-cov - adds code coverage support

--ignore=some_folder
It can be used multiple times to exclude multiple folders.
