Skip to content

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

Closed

Description

@nmoreaud

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 (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%

Activity

  1. eleanorjboyd commented on Jun 5, 2023

    @eleanorjboyd

    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
  2. nmoreaud commented on Jun 7, 2023

    @nmoreaud
    Author

    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"

  3. nmoreaud commented on Jun 7, 2023

    @nmoreaud
    Author

    sample_folder:

    pytest.mp4
  4. eleanorjboyd commented on Jun 7, 2023

    @eleanorjboyd

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

  5. eleanorjboyd commented on Oct 4, 2023

    @eleanorjboyd

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

  6. locked as resolved and limited conversation to collaborators on Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-testinginfo-neededIssue requires more information from postertriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions