How This Book Is Organized
In Chapter 1, Getting Started with pytest, you’ll install pytest and get it ready to use. You’ll then take one piece of the Tasks project—the data structure representing a single task (a namedtuple called Task)—and use it to test examples. You’ll learn how to run pytest with a handful of test files. You’ll look at many of the popular and hugely useful command-line options for pytest, such as being able to re-run test failures, stop execution after the first failure, control the stack trace and test run verbosity, and much more.
In Chapter 2, Writing Test Functions, you’ll install Tasks locally using pip and look at how to structure tests within a Python project. You’ll do this so that you can get to writing tests ...
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