skip to Main Content

I’m using

  • VS Code Version: 1.96.2
  • Python 3.11.8
  • MacOS Sonoma 14.5

I have a project that’s been working for a long time, but now VS Code is failing to discover/run my tests. When I go into the TESTING tab, I have a progress indicator that keep running forever and the test output is showing 0/0 tests run. It looks like it’s stuck in test discovery. Clicking the refresh button doesn’t help; I just get:

2025-01-04 23:02:05.066 [info] Running discovery for pytest using the new test adapter.
2025-01-04 23:02:05.066 [error] Test discovery already in progress, not starting a new one.

in the output tab. There are no problems listed in the problems tab. If I got into the terminal window and run the tests manually, all is good:

(.venv) roysmith@Roys-Mac-Mini dyk-tools % pytest
============================================================================== test session starts ===============================================================================
platform darwin -- Python 3.11.8, pytest-8.3.3, pluggy-1.5.0
rootdir: /Users/roysmith/dev/dyk-tools
plugins: socket-0.7.0, mock-3.14.0
collected 150 items                                                                                                                                                              

src/tests/bot/test_dykbot.py ..............                                                                                                                                [  9%]
src/tests/db/test_models.py ...                                                                                                                                            [ 11%]
src/tests/test___init__.py .                                                                                                                                               [ 12%]
src/tests/test_conftest.py .                                                                                                                                               [ 12%]
src/tests/web/test_core.py ......                                                                                                                                          [ 16%]
src/tests/web/test_data.py ......                                                                                                                                          [ 20%]
src/tests/wiki/test_article.py ........................                                                                                                                    [ 36%]
src/tests/wiki/test_hook.py .............................                                                                                                                  [ 56%]
src/tests/wiki/test_hook_set.py .........                                                                                                                                  [ 62%]
src/tests/wiki/test_nomination.py ............x......................                                                                                                      [ 85%]
src/tests/wiki/test_nomination_list.py ......................                                                                                                              [100%]

========================================================================= 149 passed, 1 xfailed in 4.15s =========================================================================

The only thing I can think of is that I’ve been refactoring my .zsh startup files so perhaps I messed up something in my environment, but given that the tests run manually, that seems unlikely. Any ideas what I might have broken?

2

Answers


  1. Chosen as BEST ANSWER

    Looks like this is https://github.com/microsoft/vscode-python/issues/24656

    Adding some extra text because StackOverflow apparently insists an answer must be 30 characters or longer...


  2. Roy Smith’s suggestion worked for me
    https://github.com/microsoft/vscode-python/issues/24656 downgrading the python basically it’s downgrading the python extension to version 2024.22.0 which fixed it and let’s the discovery succeed again

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search