Skip to content
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

"Restart debugging" button doesn't work when debugging tests #22576

Closed
shaperilio opened this issue Nov 30, 2023 · 2 comments
Closed

"Restart debugging" button doesn't work when debugging tests #22576

shaperilio opened this issue Nov 30, 2023 · 2 comments
Assignees
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug needs PR Ready to be worked on

Comments

@shaperilio
Copy link

I put this as the only configuration in my launch.json (taken from your docs)

{
  "name": "Python: Debug Tests",
  "type": "python",
  "request": "launch",
  "program": "${file}",
  "purpose": ["debug-test"],
  "console": "integratedTerminal",
  "justMyCode": false
}

I write a simple test and put a breakpoint in it. When the breakpoint is hit, I click on the restart debugging button:
image

Debugging stops but the debugger that is started is not the one that runs unit tests; maybe related to #22530.

In the terminal, the first debug run puts out this command:

& 'c:\Users\1\repo\venv\Scripts\python.exe' 
'c:\Users\1\.vscode\extensions\ms-python.python-2023.4.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '51632' 
'--' 
'c:\Users\1\.vscode\extensions\ms-python.python-2023.4.1\pythonFiles\testlauncher.py' 
'c:\Users\1\repo' 'pytest' '--rootdir' 'c:\Users\1\repo' '--override-ini' 'junit_family=xunit1' '--junit-xml=C:\Users\1\AppData\Local\Temp\tmp-30092H3SpqtSp80pj.xml' '-vv' '--capture' 'no' './tests/test_file.py::test_foo'

The restart does this:

c:; cd 'c:\Users\1\repo'; 
& 'c:\Users\1\repo\venv\Scripts\python.exe' 
'c:\Users\1\.vscode\extensions\ms-python.python-2023.4.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '51716' 
'--' 
'C:\Users\1\repo\tests\test_file.py'

The difference is the actual command being run.

Version: 1.84.2 (user setup)
Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
Date: 2023-11-09T10:51:52.184Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045

Python extension version v2023.20.0

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Nov 30, 2023
@paulacamargo25 paulacamargo25 added bug Issue identified by VS Code Team member as probable bug and removed triage-needed Needs assignment to the proper sub-team labels Dec 14, 2023
@paulacamargo25
Copy link

Thanks for your bug report, i could repo the error.

@paulacamargo25 paulacamargo25 added the needs PR Ready to be worked on label Dec 14, 2023
@eleanorjboyd
Copy link
Member

Hi! We put in a fix for this so it should be good now! Let me know if not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug needs PR Ready to be worked on
Projects
None yet
Development

No branches or pull requests

5 participants