© Moritz Lenz 2019
Moritz LenzPython Continuous Integration and Deliveryhttps://doi.org/10.1007/978-1-4842-4281-0_2

2. Unit Testing in Python

Moritz Lenz1 
(1)
Fürth, Bayern, Germany
 
Many programmers manually test the code they are writing by calling the piece of code they are developing, printing the result to the console, and visually scanning the output for correctness. This works for simple tasks but suffers from some problems:
  • When the output gets large, it becomes harder to spot errors.

  • When the programmer tires, it is easy to miss subtly incorrect output.

  • When the implemented feature becomes larger, one tends to miss regressions in parts that were “tested” earlier.

  • Because the informal test scripts are generally only useful for the programmer who ...

Get Python Continuous Integration and Delivery: A Concise Guide with Examples 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.