This training focuses on several aspects of PyTest. At the end of this training, you should be comfortable with marks, fixtures, parametrization, error handling and temporary_paths.
Create a virtual environment for this repo, for instance with Anaconda:
conda create --name testing_for_ds -y python=3.10
conda activate testing_for_ds
You can use the same virtual environment for the whole training.
Note: if you just installed anaconda, you might have to initialize your terminal with conda init <SHELL_NAME>
and restart your terminal afterwards.
Install the project in develop mode, with:
pip install -e ".[develop]"
This will install all the dependencies listed in requirements.txt
and requirements.dev.txt
. Have a look at them to get an idea with what we're working.
We will be using pre-commit for this project, install it with:
pre-commit install
If you commit your code, pre-commit will run some checks. Only if you pass the checks, the commit is completed. For example, it checks whether you've used type-hinting. See .pre-commit-config.yaml for the full configuration.
git checkout -b <branch-name>
git push
After you completed the installation, work yourself through the exercises in the tests\test_<subject>.py
.
It's recommended to make at least the exercises marked with an '*', but try to make as many exercises as possible as
they will cover even more information than given in the slides.
You've completed the assignment if:
- You answered all exercises.
- All the tests pass.
- The pre-commit steps are successful.
- You pushed your code to your personal branch.
Please let me know if you have any questions!