Description
An automated test suite makes it much easier to maintain, extend and debug your Python code. In this course we will learn how to write automated tests in Python using the pytest library. After introducing the key concepts, the majority of the course will be hands-on, writing and running tests.
Slides
Sample code
A sample project including a test suite is provided at github.com/ssciwr/python-testing-intro
To clone the repo:
git clone https://github.com/ssciwr/python-testing-intro.git
cd python-testing-intro
To install the required Python libraries:
python -m pip install -r requirements.txt
To run the tests:
python -m pytest