You are debugging a failing test in pytest and need to inspect the values of variables at the point of failure. Which pytest option would you use to achieve this?

  • Employ the --capture option
  • Enable pytest logging with the --log-level option
  • Use the --pdb option
  • Utilize the --verbose option
To inspect variable values at the point of failure during debugging in pytest, you can use the --pdb option. This option invokes the Python Debugger (pdb) when a test fails, allowing you to interactively explore variables and the execution context.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *