Loading topic
breakpoint() built-in does this. You add one line to your code, run the program as usual, and execution pauses at that point inside the Python debugger, pdb. This chapter covers what breakpoint() does, w6 min read(Pdb) prompt that breakpoint() opens. It covers the second way to start pdb: handing it the whole program from the command line, with no edits to the source.5 min read(Pdb) prompt. It assumes you can start a pdb session with breakpoint() or python -m pdb, and that you can read a traceback and follow Python functions, loops, and exceptions.6 min read(Pdb) prompt, the next question is what state it holds. This chapter covers the commands that answer it: p, pp, args, whatis, list, longlist, display, and a few related ones.5 min readbreakpoint() or python -m pdb, and that you know n, s, and c from the stepping chapter. Here you will learn to manage breakpoints. A breakpoint is a location where pdb stops the program and gives you the (Pdb) prompt. A sessio5 min readc 10,000 times to reach the one iteration that matters. Conditions and ignore counts let you tell pdb which pass you care about.6 min readbreakpoint() or python -m pdb. It also assumes you can set a breakpoint with b and move around with n, s, and c. If a breakpoint number or the (Pdb) prompt is unfamiliar, review the earlier chapters on breakpoints first.6 min readbreakpoint(), read a traceback, and set an environment variable in your shell. It covers how breakpoint() decides what to run, what values PYTHONBREAKPOINT accepts, and the mistakes that most often surprise people.5 min readbreakpoint() or python -m pdb, and that you know the basic commands (p, pp, n, s, c, l). It also assumes you know what an environment variable is and where your home directory is. If you keep typing the same commands at every `(Pd5 min readn, s, c, p, w, b). It also assumes you know how to set an environment variable. Here you will combine those commands into a repeatable method.6 min readpytest from a terminal, and use the basic pdb commands (n, s, c, p, w, up, down). It also assumes you know what breakpoint() does. Here you will connect those tools to pytest. A failing test is a reproducible crash, whi6 min readbreakpoint() or python -m pdb. It also assumes you can step, inspect variables, and set breakpoints, and that you know what PYTHONBREAKPOINT does. It covers what pdb cannot do well, which tools cover those gaps, and how to choose among them6 min read