Replies: 1 comment
-
Awesome work @fantauzzi !! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It is possible to configure the vscode debugger to run and debug Brownie scripts, including unit testing. I find the vscode debugger more productive and user-friendly than
pdb
.Here how the vscode debugger can be configured to work with Brownie scripts and unit-tests.
Run and Debug
button on the left bar (or the menuView > Run
)RUN AND DEBUG
menu (top-left) and chooseAdd Configuration...
launch.json
should open, also a menu, pressEsc
to close the menu without choosing anything from itlaunch.json
. If you already have in there previous debugging configurations that you want to keep, copy only theconfigurations
section from the script below into the corresponding section of yourlaunch.json
program
entry, you must set its value to the complete (absolute) path to yourbrownie
executable, replacing the path I am using (/home/fanta/.local/virtualenv/python3.10/bin/brownie
)Note: to find where your
brownie
executable is, you can run in the shell:which brownie
To debug:
Run and Debug
button on the left (or the menuView > Run
)RUN AND DEBUG
pull-down menu and choose a configuration from it▷
button next toRUN AND DEBUG
.Note that is is possible to issue commands in Python in the debug console, pretty much like from the Brownie console, but with the benefit of being in the execution context of the scripts, with access to their functions, classes, variables and imported packages.
It is quite easy to customize/improve the
launch.json
; taking a gander at it, you can see how to add entries to theRUN AND DEBUG
menu, how to add other networks to choose from, options to run Brownie, etc.Here the
launch.json
scriptBeta Was this translation helpful? Give feedback.
All reactions