Skip to content

Debugging tests is not stopping on breakpoint #1175

@pcolmer

Description

@pcolmer

Type: Bug

Behaviour

Expected vs. Actual

Expected: setting a breakpoint on a test and then debugging the test should trigger the breakpoint to enable step-by-step execution of the test.

Actual: the test just runs through. The debugger panel appears at the top of the window but the debugger never stops execution of the code.

Steps to reproduce:

  1. Right-click on the green run button in the test file's gutter.
  2. Click "Add breakpoint". Green run button turns red.
  3. Right-click and choose "Debug Test".

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.4
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): PipEnv
  • Value of the python.languageServer setting: Pylance
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Experiment 'pythonSurveyNotification' is active
Experiment 'pythonPromptNewToolsExt' is active
LSP Notebooks experiment is enabled
LSP Notebooks interactive window support is enabled
Python interpreter path: ~/.local/share/virtualenvs/sd-webhook-framework-zRqUmWf2/bin/python
Starting Pylance language server.
> . ~/.local/share/virtualenvs/sd-webhook-framework-zRqUmWf2/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/printEnvVariables.py
> ~/.local/share/virtualenvs/sd-webhook-framework-zRqUmWf2/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear tests
cwd: .
> conda info --json
[ERROR 2023-0-13 10:3:12.74]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/cdk-static-websites-AZV3rDYY doesn't contain a valid path to the project
> . ~/.local/share/virtualenvs/sd-webhook-framework-zRqUmWf2/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/printEnvVariables.py
> ~/.pyenv/versions/2.7.18/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:12.169]: [Error: Command failed: /home/philip/.pyenv/versions/2.7.18/bin/python -I /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
Unknown option: -I
usage: /home/philip/.pyenv/versions/2.7.18/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

	at ChildProcess.exithandler (node:child_process:399:12)
	at ChildProcess.emit (node:events:526:28)
	at maybeClose (node:internal/child_process:1092:16)
	at Socket.<anonymous> (node:internal/child_process:451:11)
	at Socket.emit (node:events:526:28)
	at Pipe.<anonymous> (node:net:687:12)] {
  killed: false,
  code: 2,
  signal: null,
  cmd: '/home/philip/.pyenv/versions/2.7.18/bin/python -I /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py'
}
> ~/.pyenv/versions/3.10.4/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:12.224]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/cdk-static-websites-AZV3rDYY doesn't contain a valid path to the project
> ~/.local/share/virtualenvs/cdk-static-websites-AZV3rDYY/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> ~/.local/share/virtualenvs/cdk-static-websites-zOm9C-Wd/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:12.375]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/confluence-group-pages-vmmibARp doesn't contain a valid path to the project
> ~/.local/share/virtualenvs/clo-ci-hook-OU6ckUa1/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> ~/.local/share/virtualenvs/confluence-group-pages-_umzou8g/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:12.471]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/confluence-page-updater-_P6vGlGI doesn't contain a valid path to the project
[ERROR 2023-0-13 10:3:12.473]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/confluence-group-pages-vmmibARp doesn't contain a valid path to the project
> ~/.local/share/virtualenvs/confluence-group-pages-vmmibARp/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> ~/.local/share/virtualenvs/confluence-page-updater-OFi23sKt/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:12.535]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/confluence-page-updater-_P6vGlGI doesn't contain a valid path to the project
> ~/.local/share/virtualenvs/confluence-page-updater-_P6vGlGI/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:12.564]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/github-action-scripts-hT4-2zLM doesn't contain a valid path to the project
> ~/.local/share/virtualenvs/eks-billing-analysis-YhPQZTVO/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> ~/.local/share/virtualenvs/exit-automation-9lqs4NWf/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:12.643]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/github-action-scripts-hT4-2zLM doesn't contain a valid path to the project
> ~/.local/share/virtualenvs/github-action-scripts-hT4-2zLM/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:12.684]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/ldap-sanity-BphR30kE doesn't contain a valid path to the project
> ~/.local/share/virtualenvs/jekyll-link-checker-WxNPQe40/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:12.721]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/lifecycle-test-qM84hlPr doesn't contain a valid path to the project
> ~/.local/share/virtualenvs/ldap-sanity-BQOcVU3w/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:12.751]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/ldap-sanity-BphR30kE doesn't contain a valid path to the project
> ~/.local/share/virtualenvs/ldap-sanity-BphR30kE/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:12.779]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/lifecycle-test-qM84hlPr doesn't contain a valid path to the project
> ~/.local/share/virtualenvs/lifecycle-test-qM84hlPr/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> ~/.local/share/virtualenvs/lounge-maintenance-TCBpnHdh/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> ~/.local/share/virtualenvs/meet-the-team---confluence-3171jp1c/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> ~/.local/share/virtualenvs/octopus-import-x-Zfgh2O/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> ~/.local/share/virtualenvs/resources.linaro.org-4AmrWW0f/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> ~/.local/share/virtualenvs/sd-webhook-framework-zRqUmWf2/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> ~/.local/share/virtualenvs/servicedesk-automation-tJXR8Tdr/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:13.28]: [Error: Command failed: /home/philip/.local/share/virtualenvs/servicedesk-automation-tJXR8Tdr/bin/python -I /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
Unknown option: -I
usage: /home/philip/.local/share/virtualenvs/servicedesk-automation-tJXR8Tdr/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

	at ChildProcess.exithandler (node:child_process:399:12)
	at ChildProcess.emit (node:events:526:28)
	at maybeClose (node:internal/child_process:1092:16)
	at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)] {
  killed: false,
  code: 2,
  signal: null,
  cmd: '/home/philip/.local/share/virtualenvs/servicedesk-automation-tJXR8Tdr/bin/python -I /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py'
}
> /bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> /usr/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> ~/.pyenv/versions/3.10.4/bin/python3.10 -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
> ~/.pyenv/versions/2.7.18/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:14.208]: [Error: Command failed: /home/philip/.pyenv/versions/2.7.18/bin/python -I /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
Unknown option: -I
usage: /home/philip/.pyenv/versions/2.7.18/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

	at ChildProcess.exithandler (node:child_process:399:12)
	at ChildProcess.emit (node:events:526:28)
	at maybeClose (node:internal/child_process:1092:16)
	at Socket.<anonymous> (node:internal/child_process:451:11)
	at Socket.emit (node:events:526:28)
	at Pipe.<anonymous> (node:net:687:12)] {
  killed: false,
  code: 2,
  signal: null,
  cmd: '/home/philip/.pyenv/versions/2.7.18/bin/python -I /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py'
}
> ~/.local/share/virtualenvs/servicedesk-automation-tJXR8Tdr/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
[ERROR 2023-0-13 10:3:15.53]: [Error: Command failed: /home/philip/.local/share/virtualenvs/servicedesk-automation-tJXR8Tdr/bin/python -I /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py
Unknown option: -I
usage: /home/philip/.local/share/virtualenvs/servicedesk-automation-tJXR8Tdr/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

	at ChildProcess.exithandler (node:child_process:399:12)
	at ChildProcess.emit (node:events:526:28)
	at maybeClose (node:internal/child_process:1092:16)
	at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)] {
  killed: false,
  code: 2,
  signal: null,
  cmd: '/home/philip/.local/share/virtualenvs/servicedesk-automation-tJXR8Tdr/bin/python -I /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/get_output_via_markers.py /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/interpreterInfo.py'
}
[ERROR 2023-0-13 10:3:15.132]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/cdk-static-websites-AZV3rDYY doesn't contain a valid path to the project
[ERROR 2023-0-13 10:3:15.144]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/cdk-static-websites-AZV3rDYY doesn't contain a valid path to the project
[ERROR 2023-0-13 10:3:15.155]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/confluence-group-pages-vmmibARp doesn't contain a valid path to the project
[ERROR 2023-0-13 10:3:15.164]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/confluence-page-updater-_P6vGlGI doesn't contain a valid path to the project
[ERROR 2023-0-13 10:3:15.165]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/confluence-group-pages-vmmibARp doesn't contain a valid path to the project
[ERROR 2023-0-13 10:3:15.173]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/confluence-page-updater-_P6vGlGI doesn't contain a valid path to the project
[ERROR 2023-0-13 10:3:15.185]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/github-action-scripts-hT4-2zLM doesn't contain a valid path to the project
[ERROR 2023-0-13 10:3:15.194]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/github-action-scripts-hT4-2zLM doesn't contain a valid path to the project
[ERROR 2023-0-13 10:3:15.200]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/ldap-sanity-BphR30kE doesn't contain a valid path to the project
[ERROR 2023-0-13 10:3:15.204]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/lifecycle-test-qM84hlPr doesn't contain a valid path to the project
[ERROR 2023-0-13 10:3:15.214]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/ldap-sanity-BphR30kE doesn't contain a valid path to the project
[ERROR 2023-0-13 10:3:15.218]: The .project file inside environment folder: /home/philip/.local/share/virtualenvs/lifecycle-test-qM84hlPr doesn't contain a valid path to the project
DAP Server launched with command: /home/philip/.local/share/virtualenvs/sd-webhook-framework-zRqUmWf2/bin/python /home/philip/.vscode-server-insiders/extensions/ms-python.python-2023.1.10111008/pythonFiles/lib/python/debugpy/adapter

User Settings


languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

Extension version: 2022.20.2
VS Code version: Code - Insiders 1.75.0-insider (6d40104789d03d41b8866a1e57847dae14c5cf0d, 2023-01-12T05:34:21.597Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: Yes
Remote OS version: Linux x64 5.15.79.1-microsoft-standard-WSL2

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 2995)
GPU Status 2d_canvas: enabled
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
Load (avg) undefined
Memory (System) 15.84GB (3.63GB free)
Process Argv --folder-uri=vscode-remote://wsl+Ubuntu-20.04/home/philip/git/sd-webhook-framework --remote=wsl+Ubuntu-20.04 --crash-reporter-id 5232007f-9efe-473e-882d-54feb508997f
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu-20.04
OS Linux x64 5.15.79.1-microsoft-standard-WSL2
CPUs 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 2995)
Memory (System) 7.68GB (5.35GB free)
VM 0%
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
vscod805:30301674
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30404738
cppdebug:30492333
vsclangdf:30492506
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30618038
pylantcb52:30590116
pyindex848:30611229
nodejswelcome1:30587009
pyind779:30611226
pythonsymbol12cf:30622697
fim-prod:30623723

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions