Lot of programmers use Python on daily basis, hardly few write tests. Writing tests can be daunting task. Tests gives lot of confidence for shipping the code. Automated tests saves lot of developer time during refactor.
This tutorial will teach audience how to write unit test, functional tests using unittest, py.test, mock and coverage library.
Objective of the tutorial is to make audience write better and useful tests. If something is hard to test, the abstraction is broken. In general testable code is good code.
Tutorial will use simple command line phonebook application which can be found here. During the course of the tutorial tests will be added to the application. These tests will be unit tests, functional tests.
The tutorial will use python standard library unittest, pytest, mock, coverage. Tutorial will not cover testing web applications with selenium.
While creating large application like web application the external service are generally mocked like database, email server etc ... Mock libraries provides set functionality to test complicated cases.
Audience should be comfortable using Command Line, virtualenv, pip and running tests from command line.
The code for the workshop will be available in https://github.com/kracekumar/UTFT . We will using Python 2.7.