[Python] VSCode Test Explorer hangs despite no errors in the output & all tests being...

Discussão em 'Python' iniciado por Stack, Junho 2, 2025.

  1. Stack

    Stack Membro Participativo

    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.

    [​IMG]

    And that is despite the fact that the output shows that the tests seem to be discovered correctly in the output window: [​IMG]

    The tests are also all passing if I run them with standard pytest terminal command: [​IMG]

    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
    And my settings.json file is currently this (I tried all sorts of different settings in accordance with various articles on Stack Overflow, but none has worked so far): [​IMG]

    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: [​IMG]

    I hope somebody can help, because I am slowly losing my mind over this :(.

    Continue reading...

Compartilhe esta Página