Skip to content
164: Debugging Python Test Failures with pytest episode artwork

EPISODE · Sep 14, 2021 · 12 MIN

164: Debugging Python Test Failures with pytest

from Test & Code · host Brian Okken

An overview of the pytest flags that help with debugging. From Chapter 13, Debugging Test Failures, of Python Testing with pytest, 2nd edition. pytest includes quite a few command-line flags that are useful for debugging. We talk about thes flags in this episode. Flags for selecting which tests to run, in which order, and when to stop: -lf / --last-failed: Runs just the tests that failed last. -ff / --failed-failed: Runs all the tests, starting with the last failed. -x / --exitfirst: Stops the tests session afterEd: after?Author: yep the first failure. --maxfail=num: Stops the tests after num failures. -nf / --new-first: Runs all the tests, ordered by file modification time. --sw / --stepwise: Stops the tests at the first failure. Starts the tests at the last failure next time. --sw-skip / --stepwise-skip: Same as --sw, but skips the first failure. Flags to control pytest output: -v / --verbose Displays all the test names, passing or failing. --tb=[auto/long/short/line/native/no] Controls the traceback style. -l / --showlocals Displays local variables alongside the stacktrace. Flags to start a command-line debugger: --pdb Starts an interactive debugging session at the point of failure. --trace Starts the pdb source-code debugger immediately when running each test. --pdbcls Uses alternatives to pdb, such as IPython’s debugger with –-pdbcls=IPython.terminal.debugger:TerminalPdb. This list is also found in Chapter 13 of Python Testing with pytest, 2nd edition. The chapter is "Debugging Test Failures" and covers way more than just debug flags, while walking through debugging 2 test failures. Links: Python Testing with pytest — The fastest way to get up to speed on pytest. all pytest flags in pytest 6.2.x

Episode metadata supplied by the publisher feed · Published Sep 14, 2021

Embed this episode

Ready to play

164: Debugging Python Test Failures with pytest

0:00 12:34

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

No similar episodes found.

French Your Way Jessica: Native French teacher founder of French Your Way Boost your French listening skills and test your comprehension with this one of a kind series of podcasts. Get the chance to listen to a real conversation between native speakers talking at normal speed AND customise your learning experience through carefully designed sets of questions (2 levels of difficulty) available for download at www.frenchvoicespodcast.com. All interviews also come with the transcript. French teacher Jessica interviews native speakers of French from around the world who share a bit of their life and passion. Where else would you meet in one same place a French yoga teacher based in Melbourne, a soap manufacturer from Provence, or a couple cycling around the world? Insurance Exam Queen Melissa Dillon Hi, I am Melissa, the Insurance Exam Queen. I’m the most requested Exam Prep Instructor in the U.S. and have helped thousands of people pass their Property & Casualty and Life & Health insurance exam with ease. With a long string of ONLY 5 star reviews, I’ve become known for my casual and simple teaching style, and my students love the fun memorization techniques, charts, graphs and other visual aides I use to help you understand the material. Most of my students pass their 1st or next time after going through one of my Class Series Packages. I simplify everything, tell you what to study, and even include everything from Study Notes to my own personal Practice Test to help you focus ONLY on what you need to know in order to pass the test. View my packages here: http://www.insuranceexamqueen.com Code Together Code Together Code Together is an interview series that explores challenges at the forefront of cross-architecture development. We’ll talk with those at Intel and across the industry who are forging a path on this often treacherous journey through an increasingly diverse, data-centric world. Join the conversation at oneapi.com. French Voices Podcast | Learn French | Interviews with Native French Speakers | French Culture Jessica: Native French teacher, founder of French Your Way French teacher Jessica interviews native speakers of French from around the world who share a bit of their life and passion. Learn French and boost your listening skills as you get the chance to follow a real conversation between native French people talking at normal speed AND customise your French learning experience. All interviews come with questions to test your comprehension, transcription and a list of specific French vocabulary available for free download at http://www.frenchvoicespodcast.com. Get a slice of French culture! Where else would you meet in one same place a French yoga teacher based in Melbourne, a soap manufacturer from Provence, or a couple cycling around the world? Suitable for upper intermediate and advanced students of French.

Frequently Asked Questions

How long is this episode of Test & Code?

This episode is 12 minutes long.

When was this Test & Code episode published?

This episode was published on September 14, 2021.

Can I download this Test & Code episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!