View on GitHub

Introduction to Python Testing

SSC Compact Course


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.


download slides as pdf download course description as pdf

Sample code

A sample project including a test suite is provided at

To clone the repo:

git clone
cd python-testing-intro

To install the required Python libraries:

python -m pip install -r requirements.txt

To run the tests:

python -m pytest