Skip to content

Pytest: stop on any failure in tests #1873

@k4nar

Description

@k4nar

When I’m debugging a test with VSCode, I’m expecting the debugger to automatically add a breakpoint at the line where the test is failing.

This is the behavior of pytest with the option --pdb, so I think it’s reasonable to expect the same when using it with VSCode.

In the FAQ the recommended solution is to use "User Uncaught Exceptions". However this is not practical with any "real world" codebase: breakpoints are added in a lot of exceptions handled by third parties or Python itself (see #1248, #1102, #1155, …). In my case I would have to skip dozens of breakpoints each time, and those exceptions are legitimate.

Note: this feature has been requested before (#722, #723, #1103), but the suggested solutions did not work for me.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions