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.
Loading...
Related Quiz
- You are tasked with optimizing a RESTful API that experiences high traffic and heavy load. Which caching mechanism would be most appropriate to reduce server load and improve response times?
- How can you invoke the method of a superclass from a subclass?
- You are developing a web application where the front-end needs to continuously receive real-time updates from the Python back-end. Which technology would you use to implement this functionality?
- To represent a constant property in a Python class, you would typically use _____.
- Which Python module would you use for measuring the performance of small code snippets?