Skip to content

After latest update: Testing tree of python tests reloads completely rather than just update #25822

Description

@tepedersen

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version:
  • Version: 1.109.5
    Commit: 072586267e68ece9a47aa43f8c108e0dcbf44622
    Date: 2026-02-19T19:43:32.382Z
    Electron: 39.3.0
    ElectronBuildId: 13313481
    Chromium: 142.0.7444.265
    Node.js: 22.21.1
    V8: 14.2.231.22-electron.0
    OS: Linux x64 6.17.0-14-generic
  • OS Version: Ubuntu 25.10

Prior to the latest update (I think, I've been coding in the typescript part of my codebase for a couple of weeks and just recently returned to the python part) changing code would discover new tests and update the test-tree in the Testing view in situ, ie adding a new test-method and saving would cause it to appear in the list of tests.

Now, any change (even just adding an empty line in a random, non-test feil, as in the video below) will cause the entire "Python Tests" tree to be removed and then rebuild from scratch, see video below. This causes flicker and delays from saving a file to being able to find the test and re-run it. The vitest part of the tests does not have this issue, leading me to think it an issue specific to python and python test discovery/updating of test list in Testing view

No changes in project setup or extensions prior to this issue appearing. Tried "Python: Clear cache and Reload window" and multiple restarts of VS Code.

Steps to Reproduce:

  1. Make any change in any .py file
  2. Save file

Image

Output log from Python during a save attached

Python-after-save-file.log

Activity

  1. eleanorjboyd commented on Feb 27, 2026

    @eleanorjboyd
    Member

    thanks will take a look!

  2. added
    bugIssue identified by VS Code Team member as probable bug
    confirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.
    and removed
    triage-neededNeeds assignment to the proper sub-team
    on Mar 13, 2026
  3. BlackZork commented on Mar 14, 2026

    @BlackZork

    Same here on:

    Version: 1.111.0
    Commit: ce099c1ed25d9eb3076c11e4a280f3eb52b4fbeb
    Date: 2026-03-06T23:06:10Z
    Electron: 39.6.0
    ElectronBuildId: 13330601
    Chromium: 142.0.7444.265
    Node.js: 22.22.0
    V8: 14.2.231.22-electron.0
    OS: Linux x64 6.19.6-arch1-1
    

    and ms-python.python 2026.4.0

  4. BlackZork commented on Mar 14, 2026

    @BlackZork

    On my second machine with older packages this does not happen:

    Version: 1.108.2
    Commit: c9d77990917f3102ada88be140d28b038d1dd7c7
    Date: 2026-01-21T13:52:09.270Z
    Electron: 39.2.7
    ElectronBuildId: 12953945
    Chromium: 142.0.7444.235
    Node.js: 22.21.1
    V8: 14.2.231.21-electron.0
    OS: Linux x64 6.18.5-arch1-1
    

    ms-python.python 2026.4.0, too.

  5. tepedersen commented on Mar 18, 2026

    @tepedersen
    Author

    Still broken on:
    Version: 1.111.0
    Commit: ce099c1ed25d9eb3076c11e4a280f3eb52b4fbeb
    Date: 2026-03-06T23:06:10Z
    Electron: 39.6.0
    ElectronBuildId: 13330601
    Chromium: 142.0.7444.265
    Node.js: 22.22.0
    V8: 14.2.231.22-electron.0
    OS: Linux x64 6.17.0-19-generic

  6. BlackZork commented on Mar 18, 2026

    @BlackZork

    Same config as one of my own installs. I stick with 1.108.2 for now.

  7. Jurriaan-BlueGen commented on Mar 23, 2026

    @Jurriaan-BlueGen

    I have the same issue. It's especially annoying because it takes a while for the collection to finish, and in the mean time, simple things like re-running the same test, or debugging a test just fail, because the test has been cleared.

  8. robin-blanchard commented on Apr 8, 2026

    @robin-blanchard

    The same issue occurs to me in one specific repository, when VSCode is open via Dev Containers. I found out the python.testing.autoTestDiscoverOnSaveEnabled option, which is enabled by default. Disable it to have control on when the tests are reloaded

  9. tepedersen commented on Apr 19, 2026

    @tepedersen
    Author

    My workspace included a folder with a large number of files. After explicitly limiting which folders vs code searches for tests in (thus excluding the folder with numerous nested dirs), the delay when reloading has improved, but it is still there.

    This allowed me to keep autoTestDiscoverOnSaveEnabled for now.

    A fix might be to incrementally reload the test tree, rather than just replacing it? Test discovery could run in the background, do a diff between discovered tests and the existing test tree in the GUI and just insert/remove?

  10. senese commented on Jul 30, 2026

    @senese

    Same here! Several updates later and it still happens:

    Version: 1.131.0 (system setup)
    Commit: e4c7e7b1d6d060162f4aa7f8225271b67ce1df75
    Date: 2026-07-28T10:51:25Z
    Electron: 42.7.0
    ElectronBuildId: 14710161
    Chromium: 148.0.7778.280
    Node.js: 24.18.0
    V8: 14.8.178.38-electron.0
    OS: Windows_NT x64 10.0.26200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-testingbugIssue identified by VS Code Team member as probable bugconfirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions