-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JustMyCode doesn't work when debugging python tests through the GUI #21249
Comments
Hi @NicolasM-Forsk, can you send me your launch.json config? Thanks |
test.code-workspace: {
"folders": [
{
"path": "/home/dev/projects/test"
}
],
"settings": {
"python.testing.pytestEnabled": true
},
"launch": {
"configurations": [
{
"name": "Python: Debug Tests",
"type": "python",
"request": "launch",
"program": "${file}",
"purpose": ["debug-test"],
"console": "integratedTerminal",
"justMyCode": false
}
]
}
} |
Here is a simple example project to reproduce the "bug": sample.zip python3 -m venv .venv
source .venv/bin/activate
pip install pytest |
Thanks @nmoreaud for the reply, I was able to reproduce the issue, what happens is that we are only reading the config from the launch.json file fro tests. We will be fixing it in the next iteration, what you can do in the meantime is put that same configuration in the launch.json file and it will work. Thank you |
Related on Stack Overflow: In VS Code, how can I disable justMyCode when running pytest in "Testing" tab |
Note: creating a separate Here is what happens:
|
Hi @nmoreaud thanks for the bug report, Could you create a new issue with this other error? This issue will be about the previous one. Thanks |
Ok, I opened this other issue: #21365 |
Verification steps:
{
"folders": [
{
"path": "/home/dev/projects/test"
}
],
"settings": {
"python.testing.pytestEnabled": true
},
"launch": {
"configurations": [
{
"name": "Python: Debug Tests",
"type": "python",
"request": "launch",
"program": "${file}",
"purpose": ["debug-test"],
"console": "integratedTerminal",
"justMyCode": true
}
]
}
}
|
Hi @paulacamargo25! For verification, could you provide some test file content that I could test with? Also, how would I know that justMyCode is used? |
Sure, you can try with test-issue-21249.zip.
|
Type: Bug
Behaviour
Expected vs. Actual
I cannot disable "just my code" and debug tests through the GUI.
Also, [object Object] notification keeps popping
Steps to reproduce:
When I setup the "Python: Debug Tests" configuration in my code workspace (launch section) as stated in the documentation, then click on "Testing" tab, then "Debug test", the debugger always skips thirdparty code.
https://code.visualstudio.com/docs/python/testing#_debug-tests
The same happens with "Test: Debug Test at Cursor" command.
I would like "justMyCode" to be interpreted.
Note: I have uninstalled pytest-cov and coverage and I still have the problem.
Diagnostic data
python.languageServer
setting: Defaultpytest==6.2.4
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2023.8.0
VS Code version: Code 1.78.1 (6a995c4f4cc2ced6e3237749973982e751cb0bf9, 2023-05-04T09:48:08.683Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Sandboxed: No
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
The text was updated successfully, but these errors were encountered: