VSCode Pytest fails when python.test.cwd
is set.
#23948
Labels
area-testing
bug
Issue identified by VS Code Team member as probable bug
info-needed
Issue requires more information from poster
Type: Bug
Behaviour
When setting
"python.testing.cwd": "${workspaceFolder}/src"
the testing of python code using the VSCodeTesting
feature does not work. The indicators for the tests are gray circles, not green ticks or red x. The discovery of tests works. Debugging a test does not work. I get this inTest Results
:In the debug console it prints:
Removing
"python.testing.cwd": "${workspaceFolder}/src"
makes it work. However, I require thecwd
to be set tosrc/
during testing.Steps to reproduce:
Create a folder with this structure:
and fill with these contents:
src/main.py
src/utils.py
tests/test_main.py
Debug-PyTest.code-workspace
pyproject.toml
.vscode/settings.json
Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output Panel Empty:
Extension version: 2024.12.3
VS Code version: Code 1.92.1 (eaa41d57266683296de7d118f574d0c2652e1fc4, 2024-08-07T20:16:39.455Z)
OS version: Darwin arm64 23.5.0
Modes:
Connection to 'ssh-remote+7b22686f73744e616d65223a22544f52524e4f44453134227d' could not be established
python.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: enabled_on
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_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Connection to 'ssh-remote+7b22686f73744e616d65223a22544f52524e4f44453134227d' could not be established
The text was updated successfully, but these errors were encountered: