What this book covers
Chapter 1, Introducing pytest, discusses why testing is important, gives a quick overview of the standard unittest module, and finally takes a look at pytest's main features.
Chapter 2, Writing and Running Tests, covers pytest installation, how pytest uses only the assert statement for checking values, testing module organization, and some very useful command-line options for increased productivity.
Chapter 3, Markers and Parametrization, explains how pytest markers work, how to skip tests based on certain conditions, and discusses the difference between expected failures and flaky tests (and how to deal with them). Finally, we will learn how to use the parametrize mark to apply different sets of inputs to the same piece ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access