-
Introduction
-
Testing libraries: unittest vs pytest vs nose
-
Selenium for web app testing
-
More end-to-end testing tools: requests, imapclient, subprocess
-
BDD with lettuce and behave
-
Continuous Integration with buildbot (?)
-
Devops and testing — fabric, ansible, docker
-
Wrap-up: what makes an effective test?
A few short years ago, testing in the Python world was seen as something of a luxury. Nowadays it’s more of a must-have. This report will take a look at some useful testing tools and techniques in the Python ecosystem. We’ll take a look at the standard library’s unittest, and compare it with other test frameworks like nose and the impressive py.test.
But testing should be much more than just unit testing. We’ll look beyond, showing examples of using Selenium for web app tests, and BDD tools like lettuce and behave. We’ll discuss ways of writing end-to-end tests for REST apis, command-line tools, or containerised docker services, and conclude with a discussion of how to figure out which tests are most valuable in different situations.