VSCode Test Explorer hangs despite no errors in the output & all tests being collected (in the output)
I have been having a lot of issues with Test Explorer in VSCode. It has been working fine up until last week. I was writing new tests and clicked "Refresh Tests" and then it suddenly (and pretty randomly) stopped working - specifically it "discovers" tests forever.
And that is despite the fact that the output shows that the tests seem to be discovered correctly in the output window:
The tests are also all passing if I run them with standard pytest terminal command:
My directory structure is as follows:
application
├── backend
│ ├── src
| ├── |── __init__.py
| ├── |── manage.py
| ├── |── app1
| ├── |── ├── __init__.py
| ├── |── ├── folder1
| ├── ├── ├── ├── __init__.py
| ├── |── ├── ├── views.py
| ├── |── ├── ├── class1.py
| ├── |── ├── ├── class2.py
| ├── ├── ├── ├── tests
| ├── ├── ├── ├── ├── __init__.py
| ├── ├── ├── ├── ├── test_class1.py
| ├── ├── ├── ├── ├── test_class2.py
| ├── ├── ├── ├── ├── test_views.py
| ├── |── ├── folder2
| ├── ├── ├── ├── __init__.py
| ├── |── ├── ├── views.py
| ├── |── ├── ├── class1.py
| ├── |── ├── ├── class2.py
| ├── ├── ├── ├── tests
| ├── ├── ├── ├── ├── __init__.py
| ├── ├── ├── ├── ├── test_class1.py
| ├── ├── ├── ├── ├── test_class2.py
| ├── ├── ├── ├── ├── test_views.py
| ├── |── app2
| ├── |── ...
| ├── pytest.ini
│ ├── Dockerfile
│ ├── Dockerfile.dev
One other thing that happens is that I cannot cancel test discovery or restart it. If I try, I do get an error that it has already started and cannot be restarted:
I hope somebody can help, because I am slowly losing my mind over this :(.
Move back to the previous python version (2024.22.0) the 2024.22.1 is broken right know for some config
see this link for more infos : https://github.com/microsoft/vscode-python/issues/24655