12
Automatic Testing Routines
In this chapter, we will cover the following recipes:
- Writing and executing test cases
- Testing external code
- Testing using dependency mocking
- Testing using HTTP call mocking
- Preparing testing scenarios
- Running tests selectively
Introduction
When the code and the complexity of your software grows, generating tests to ensure your program does what it is supposed to do is the best tool to provide you with a firm footing over rocky terrain.
Tests are, in essence, double-checking the code is valid and doing what it is supposed to do. This is a deceptively simple statement, but in practice, it can be very difficult.
Mastering the ability to test is a difficult task and is worth a book or two. The tasks introduced in ...
Get Python Automation Cookbook - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.