TDD in Python with pytest and mock

In this tutorial I will start a simple Python project from scratch and will develop it together with the attendees following a strict TDD methodology. The testing framework in use will be pytest, and during the training concepts like coverage, flake8 and mocks (with the official unittest.mock library) will be introduced.

The tutorial is divided in 3 sections:

Writing a Python library in TDD

Working with mocks and complex tests

Refactoring with TDD

During the tutorial we will use Python 3, but the concepts introduced are valid for Python 2 as well.