-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Use cwd value in settings #20711
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
Comments
Can you share the logs from Output > Python? what is the version of python and type of environment (conda, venv , poetry, etc)? when you say it doesn't work what exactly happens, as in do you see any errors or exceptions, debugger does not start at all. |
I'm using The test file can be pretty simple:
When I click
And
And with
|
If you set a breakpoint inside |
It wont run anything. I have nothing in the logs without breakpoints and any breakpoint I set can't be reached. |
This feels like a debugger issue, moving this to |
I have tested with pure python debugger and it works, with this
So, this looks like it's a bug inside the test python debugger. |
They are the same, What might help is getting logs for the test debug scenario. You can get that by setting
Add the above configuration to your FYI, if you want to run something as a module, you should really be using the
|
adding this to my |
If it is working then we won't need it. The issue I think is |
@eleanorjboyd @paulacamargo25 This looks like we are not setting the |
I think part of the problem might be that when you use "program" without "cwd", debugpy will use the parent directory of the program file as "cwd" by default. However, with "module", it can't do that as module name is not a filename, so there's no path to extract from it; the current directory will thus be inherited from the parent process (usually, the shell in the integrated terminal). |
woah, i'm glad you found the issue so quickly ! |
Verification steps:
|
Same. I also don't understand how this correlates with the strange |
Hi! Yes, I can see why this is an issue. It looks like the extension is not eferencing that testing cwd setting correctly when configuring the testing command. From what I am seeing in the logs you are on the rewrite of the python test adapter. Could you put this in your settings and retry: |
After opting out, the correct cwd is used! |
Yeah I am seeing the same thing right now- mine works with these settings:
and doesn't work with these:
@paulacamargo25 any idea on this? Seems like it isn't getting overridden since changing the setting matters? I will open the other issue now. |
looping in @karthiknadig |
Thanks @rzhao271 could you try with this project?
|
Type: Bug
Hello,
When I click on "Run Test", it works but "Debug Test" wont.
I have a very simple settings.json:
Extension version: 2023.1.10042123
VS Code version: Code 1.75.1 (441438abd1ac652551dbe4d408dfcec8a499b8bf, 2023-02-08T21:32:34.589Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: No
Remote OS version: Linux x64 5.15.79.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
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: