Repository navigation
Pytest restart debugger works only with code-workspace files #21365
Copy link
Copy link
Closed
Labels
area-testinginfo-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
Type: Bug
Behaviour
Expected vs. Actual
Debugger restart while running pytest should run pytest again. It currently works only for code-workspace files.
Actually, the second time, the debugger runs current python file.
Steps to reproduce:
- Open
sample_projectfolder python3 -m venv .venvsource .venv/bin/activatepip install pytest- Go to testing tab
- Add a breakpoint to
test_sample.py - Step inside
do_something - Restart debugger
Ko => debugger runs current file
Again, with a code-workspace file:
- Open
sample_workspace/sample.code-workspace
2-8. Same steps
Ok => debugger runs again the selected test
Diagnostic data
- Python version (& distribution if applicable, e.g. Anaconda): 3.8.10
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
- Value of the
python.languageServersetting: Default
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
XXX
User Settings
languageServer: "Pylance"
testing
• pytestEnabled: true
Extension version: 2023.8.0
VS Code version: Code 1.78.2 (b3e4e68a0bc097f0ae7907b217c1119af9e03435, 2023-05-10T14:39:26.248Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: No
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 2904) |
| 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 video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled |
| Load (avg) | undefined |
| Memory (System) | 31.72GB (9.62GB free) |
| Process Argv | |
| Screen Reader | no |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | WSL: Ubuntu-20.04 |
| OS | Linux x64 5.15.90.1-microsoft-standard-WSL2 |
| CPUs | Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 2904) |
| Memory (System) | 9.72GB (6.29GB free) |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | WSL: Ubuntu-20.04 |
| OS | Linux x64 5.15.90.1-microsoft-standard-WSL2 |
| CPUs | Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 2904) |
| Memory (System) | 9.72GB (6.29GB free) |
| VM | 0% |
Reactions are currently unavailable
Metadata
Metadata
Labels
area-testinginfo-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Activity
eleanorjboyd commentedon Jun 5, 2023
Hi! Thank you for the detailed steps and the example repo! I tried your steps and was unable to see the issue. When I click restart, it looks to run testing once more. Here is a recording of my steps, does this look like what your does? Any other settings which might be influencing the behavior?
restart-debugging-triage.mov
nmoreaud commentedon Jun 7, 2023
Ok, I think I see the difference between my setup and yours.
sample_project and sample_workspace should be opened in two separate VSCode instances.
The first with "Open Folder", and the second one with "Open Workspace from file"
nmoreaud commentedon Jun 7, 2023
sample_folder:
pytest.mp4
eleanorjboyd commentedon Jun 7, 2023
Thank you for the video- able to repro and will investigate now!
eleanorjboyd commentedon Oct 4, 2023
Hi! I can no longer repro this so I am closing it. We have just fixed up how some of the test flow works on the rewrite and this could have resolved this too. Let me know if you are still seeing this issue and I can take another look. (the more recent changes to the test flow are on insiders right now and will be out on stable later this week).