In Visual Studio Code, the test button on the left, the one that looks like a flask, has disappeared on my machine. I tried to run the command "Test: Run All Tests", but I get a message "No tests found in this workspace. You may need to install a test provider extension". Did I just accidentally uninstall test support in VSCode? I can still run pytest
from the command line and that works fine.
OK I found out the problem myself. It seems that there is another Python executable on my Windows machine, which seems to have come with VSCode itself, at C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe
. Somehow when I restarted VSCode, that Python executable was selected, and it didn't have pytest
or even unittest
or anything I don't think, so I guess VSCode saw that there was no testing capability at all and didn't bother showing the test button. It seems insane that VSCode comes with its own Python executable though, I wonder why that is.
EDIT Oh oops it's Visual Studio that came with the Python executable, not VSCode, obviously as the path suggests. My bad.
This is how I solved it:
- Press: ctrl + shift + p
- Type: "reload window"
- Click on
Developer: Reload Window
After that, you will see the testing button on the left panel.
The testing badge (flask icon) only appears for me in the activity bar if I have the Test Explorer UI extension installed.
I had the same issue. In my case, the problem was that my project was disconnected from its WSL target. In order to solve this, I had to navigate to the Remote Explorer on the left-hand side and right-click on my project to connect it to the WSL.
After doing that, all the tests showed up again.
It re-appeared to me when I installed the playwright extension.
© 2022 - 2025 — McMap. All rights reserved.