Exercises

The code files included in the code download for this chapter don’t have the fixes. They just have the broken code. Even if you plan to do most of your debugging with an IDE, I encourage you to try the debugging techniques in this chapter to help you understand how to use the flags and pdb commands.

  1. Create a new virtual environment and install Cards in editable mode.

  2. Run pytest and make sure you see the same failures listed in the chapter.

  3. Use --lf and --lf -x to see how they work.

  4. Try --stepwise and --stepwise-skip. Run them both a few times. How are they different than --lf and --lf -x?

  5. Use --pdb to open pdb at a test failure.

  6. Use --lf --trace to open pdb at the start of the first failing test.

  7. Fix both bugs and verify with a clean ...

Get Python Testing with pytest 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.