© 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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.