June 2017
Beginner to intermediate
274 pages
6h 49m
English
In the previous chapter, we saw various approaches to metaprogramming and programmable syntax in Python. In this chapter, we're going to take a look at the ideas behind unit testing, then move on to several test automation tools we can use to make our testing easier and more useful. We'll focus on what unit testing is, and the ideas that motivate it. We'll also discuss Python's standard unittest package and how it works.
Finally, you'll learn how to use unittest.mock to control the environment that your test code will run in so that the test will remain focused on making sure one thing works properly.
In this chapter, we'll cover the following topics:
Read now
Unlock full access