Skip to content

Pytest restart debugger works only with code-workspace files #21365

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

Closed
nmoreaud opened this issue Jun 5, 2023 · 5 comments
Closed

Pytest restart debugger works only with code-workspace files #21365

nmoreaud opened this issue Jun 5, 2023 · 5 comments
Assignees
Labels
area-testing info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@nmoreaud
Copy link

nmoreaud commented Jun 5, 2023

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:

sample.zip

  1. Open sample_project folder
  2. python3 -m venv .venv
  3. source .venv/bin/activate
  4. pip install pytest
  5. Go to testing tab
  6. Add a breakpoint to test_sample.py
  7. Step inside do_something
  8. Restart debugger
    Ko => debugger runs current file

Again, with a code-workspace file:

  1. 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.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, 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%
@eleanorjboyd
Copy link
Member

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

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jun 5, 2023
@nmoreaud
Copy link
Author

nmoreaud commented 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"

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jun 7, 2023
@nmoreaud
Copy link
Author

nmoreaud commented Jun 7, 2023

sample_folder:

pytest.mp4

@eleanorjboyd
Copy link
Member

Thank you for the video- able to repro and will investigate now!

@eleanorjboyd
Copy link
Member

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).

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Oct 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

3 participants