View on GitHub

Introduction to Python Testing

SSC Compact Course

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

download slides as pdf

Live code

During this course, the live coding will be available here:

github.com/ssciwr/python-testing-intro-live

This can be useful to keep open during the course to be able to view the current code on your computer if the slides are currently being displayed on the main screen in the course.

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