"Debug Test" ignores breakpoints, seems to ignore "debug-test" profile in launch.json
@eleanorjboyd arbeitet bereits daran.
Seit 18.9.2024.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Whenever I run "Debug Test" (from either the testing pane or by right clicking on the margin left of the code and selecting it) it runs the test just fine but it ignores breakpoints.
I've configured the following section in launch.json for "Debug Test":
{
"name": "Python: Debug Tests",
"type": "debugpy",
"request": "launch",
"console": "integratedTerminal",
"justMyCode": false, // Set to false to step into external libraries if necessary
"purpose": ["debug-test"], // Enables this configuration for "Debug Test"
"program": "${workspaceFolder}/backend/tests",
"args": ["-m", "pytest", "--capture=no"] // Run pytest with optional args (disable output capturing)
}
I have the following settings.json:
{
"python.testing.pytestArgs": [
"backend/tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
}
This is the output when I run "Debug Test":
/usr/bin/env /home/rolf/.virtualenvs/marquee/bin/python /home/rolf/.vscode-server/extensions/ms-python.debugpy-2024.10.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 35459 -- /home/rolf/.vscode-server/extensions/ms-python.python-2024.14.1-linux-x64/python_files/vscode_pytest/run_pytest_script.py --rootdir=/home/rolf/marquee --capture=no
rolf@ubundev:~/marquee$ /usr/bin/env /home/rolf/.virtualenvs/marquee/bin/python /home/rolf/.vscode-server/extensions/ms-python.debugpy-2024.10.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 35459 -- /home/rolf/.vscode-server/extensions/ms-python.python-2024.14.1-linux-x64/python_files/vscode_pytest/run_pytest_script.py --rootdir=/home/rolf/marquee --capture=no
Received JSON data in run script
Running pytest with args: ['-p', 'vscode_pytest', '--rootdir=/home/rolf/marquee', '--capture=no', '/home/rolf/marquee/backend/tests/test_gs_movie_db.py::test_get_movies']
============================= test session starts ==============================
platform linux -- Python 3.11.6, pytest-8.3.2, pluggy-1.5.0
rootdir: /home/rolf/marquee
plugins: anyio-4.4.0
collected 1 item
backend/tests/test_gs_movie_db.py F
=================================== FAILURES ===================================
What follows is a bunch of failing tests that are beyond my breakpoint (so my breakpoint should have been triggered).
I don't have "pytest-cov" installed which presence was mentioned as a possible culprit.
I've tried testing wether the launch.json profile is being used by changing the args there and seeing if they also change in the execution log which doesn't seem to be the case (the same parameters are still used). The settings from settings.json do seem to be being used.
Also, it's possible to manually select a "Debug Test" profile in the testing section but it only ever shows one default profile to choose from even if I add more to the launch.json with the same "purpose": "debug-test" (maybe that's not how that works?).
I've also tried clearing both the Python and the Python Debugger cache and restarting but that doesn't change anything (except having to reselect the right interpreter from my Python virtual env).
When I debug normally it works fine and all breakpoints that I expect to hit activate the debugger. This is the regular debugging profile:
{
"name": "Python: FastAPI with Uvicorn",
"type": "debugpy",
"request": "launch",
"module": "backend.api",
"cwd":"${workspaceFolder}",
"console": "integratedTerminal",
"env": {
"PYTHONPATH": "${workspaceFolder}"
},
"justMyCode": true
}
I'm using VSCode 1.93.1, Python extension v2024.14.1, Python Debugger extension v2024.10.0 (latest versions).
I've also tried to switch to the pre-release version of the Python Debugger (+ clearing cache) but that doesn't seem to matter for this issue.
Another thing to note is that I'm using VSCode on MacOS over an SSH session on a local Ubuntu VM.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 181
- Forks
- 126
- Ø Merge
- 8 Std. 49 Min.
- Gemergte PRs (30 T.)
- 1
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/vscode-python-debugger
-
triage-needed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
microsoft/vscode-python-debugger#1110 ·
-
triage-needed
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
microsoft/vscode-python-debugger#1024 · 1 Kommentar ·
-
triage-needed
microsoft/vscode-python-debugger#1111 · 1 Reaktion · 1 zugewiesene Person ·
-
triage-needed
microsoft/vscode-python-debugger#1104 · 1 Reaktion · 1 zugewiesene Person ·
-
triage-needed
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 58/100
microsoft/vscode-python-debugger#1095 · 1 Kommentar · 1 Reaktion ·
Alle Issues in microsoft/vscode-python-debugger
Ähnliche Issues
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
motiondivision/motion#3849 ·
-
Add: S Play Event HD Offencheck:passed streams:add
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
LiteLLM proxy response_cost (x-litellm-response-cost) is never applied to ChatModelOutput.cost Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
i-am-bee/beeai-framework#1697 · 1 Reaktion ·
-
Support bun dedupe Offenenhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
antfu/node-modules-inspector#214 ·