You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
After latest update: Testing tree of python tests reloads completely rather than just update #25822
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.
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.
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
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?
Activity
eleanorjboyd commentedon Feb 27, 2026
thanks will take a look!
BlackZork commentedon Mar 14, 2026
Same here on:
and
ms-python.python 2026.4.0BlackZork commentedon Mar 14, 2026
On my second machine with older packages this does not happen:
ms-python.python 2026.4.0, too.tepedersen commentedon Mar 18, 2026
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
BlackZork commentedon Mar 18, 2026
Same config as one of my own installs. I stick with 1.108.2 for now.
Jurriaan-BlueGen commentedon Mar 23, 2026
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.
robin-blanchard commentedon Apr 8, 2026
The same issue occurs to me in one specific repository, when VSCode is open via Dev Containers. I found out the
python.testing.autoTestDiscoverOnSaveEnabledoption, which is enabled by default. Disable it to have control on when the tests are reloadedtepedersen commentedon Apr 19, 2026
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?
senese commentedon Jul 30, 2026
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