Test Doubles with a Chat Application

We have seen how a test suite, to be reasonably reliable, should include various kinds of tests that cover components at various levels. Usually, tests, in regard to how many components they involve, are categorized into at least three kinds: unit, integration, and end-to-end.

Test doubles ease the implementation of tests by breaking dependencies between components and allowing us to simulate the behaviors we want.

In this chapter, we will look at the most common kinds of test doubles, what their goals are, and how to use them in real code. By the end of this chapter, we will have covered how to use all those test doubles and you will be able to leverage them for your own Python projects.

By adding test ...

Get Crafting Test-Driven Software with Python 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.