You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is specifically for running those tests via VSCode after opening the debugpy workspace.
The problem is that it uses debuggee.backchannel, which tries to import a bunch of stuff from debugpy.common. And this fails, because debugpy itself cannot be imported, because it's not on PYTHONPATH.
We try to make sure that it's there by setting PYTHONPATH=./src in .env - but that only works for test discovery, not for debuggee processes spawned by the tests, because the latter run in a different directory, and thus the meaning of . changes.
The fundamental problem here is that PYTHONPATH needs to be set to an absolute path for it to work consistently, and yet there's no way to use ${workspaceFolder} etc inside .env, which is necessary for that to be set in a workspace-independent way; nor is there any other way to define environment variables with expansions like that for Run Test (Debug Test can use launch.json, at least). That's microsoft/vscode-python#11932 - but in the meantime, we can hack around this in tests by checking whether debugpy comes from site-packages or not; and if not, manually add it to PYTHONPATH for debuggee.
The text was updated successfully, but these errors were encountered:
This is specifically for running those tests via VSCode after opening the debugpy workspace.
The problem is that it uses
debuggee.backchannel
, which tries to import a bunch of stuff fromdebugpy.common
. And this fails, becausedebugpy
itself cannot be imported, because it's not onPYTHONPATH
.We try to make sure that it's there by setting
PYTHONPATH=./src
in.env
- but that only works for test discovery, not for debuggee processes spawned by the tests, because the latter run in a different directory, and thus the meaning of.
changes.The fundamental problem here is that
PYTHONPATH
needs to be set to an absolute path for it to work consistently, and yet there's no way to use${workspaceFolder}
etc inside.env
, which is necessary for that to be set in a workspace-independent way; nor is there any other way to define environment variables with expansions like that for Run Test (Debug Test can use launch.json, at least). That's microsoft/vscode-python#11932 - but in the meantime, we can hack around this intests
by checking whetherdebugpy
comes from site-packages or not; and if not, manually add it toPYTHONPATH
for debuggee.The text was updated successfully, but these errors were encountered: