© Kristian Rother 2017

Kristian Rother, Pro Python Best Practices, 10.1007/978-1-4842-2241-6_9

9. Organizing Test Data

Kristian Rother

(1)Berlin, Germany

QA Engineer walks into a bar. Quickly orders a second beer before the first is served.

—@botticus

Our tests in the previous chapter were easy to write. Each test required very little input, so that the test functions were three or four lines at max. But what if we want to write tests for more complex situations? We will need to look closer at the data related to our tests. Ideally, we want to test diverse data to cover as many border cases as possible (see Figure 9-1). At the same time, we cannot cover every possible input to our program by tests. How can we implement data-driven tests? In this ...

Get Pro Python Best Practices: Debugging, Testing and Maintenance 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.