Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug Behave BDD scenario using python debugger and Visual studio Code

I use Visual studio code to edit my Behave scenarios and Python steps.

I have been able to run my steps using the Visual Studio Code console.

I have not been able to configure the python debugger to debug my Python scripts when they are called by behave.

How can I use the Visual Studion Code Python debugger with Behave.exe ? What would be the debug configuration parameters?visual studio code launch.json

like image 637
Tintin_MacFly Avatar asked Oct 09 '18 16:10

Tintin_MacFly


People also ask

How do I run a Python debugger in VS Code?

Local computer: start the VS Code debugger using the modified Python: Attach configuration and the Start Debugging button. VS Code should stop on your locally set breakpoints, allowing you to step through the code, examine variables, and perform all other debugging actions.

How do you debug an ACT test?

Behave scripts can be debugged by dry running the test steps. The dry run helps to go over all the test steps without actually running it. It helps to determine the un-defined steps in the step definition file. It verifies if there are any missing import statements, syntax errors, and so on.


1 Answers

Add configuration for start debugin current features:

{
    "name": "Python: Behave current file",
    "type": "python",
    "request": "launch",
    "module": "behave",
    "console": "integratedTerminal",
    "args": [
        "${file}"
    ]
},
like image 114
Cadoru Avatar answered Nov 15 '22 11:11

Cadoru