I always work in the bench directory, because I implement things across apps, do things on bench level, look at definitions in other apps, etc.
Sorry, I meant the VS Code debugger:
Currently I’m using it with this configuration in .vscode/launch.json (credits to @scdanieli):
{
"version": "0.3.0",
"configurations": [
{
"name": "bench run-tests --module",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/apps/frappe/frappe/utils/bench_helper.py",
"args": [
"frappe", "--site", "${input:site}", "run-tests", "--module", "${input:test}"
],
"python": "${workspaceFolder}/env/bin/python",
"cwd": "${workspaceFolder}/sites",
"env": {
"DEV_SERVER": "1"
}
}
],
"inputs": [
{
"type": "pickString",
"id": "site",
"description": "Which site?",
"options": [
"erpnext.local",
"frappe.local"
],
"default": "frappe.local"
},
{
"type": "pickString",
"id": "test",
"description": "Dotted path to test module (file)",
"options": [
"frappe.contacts.doctype.contact.test_contact"
// ...
]
}
]
}
This is slightly more work, because I need to add sites and tests manually once.