Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytest Discovery 'Hangs' #6807

Closed
ed-p-may opened this issue Jan 1, 2025 · 2 comments
Closed

Pytest Discovery 'Hangs' #6807

ed-p-may opened this issue Jan 1, 2025 · 2 comments

Comments

@ed-p-may
Copy link

ed-p-may commented Jan 1, 2025

Environment data

  • Pylance version: 2024.12.1
  • OS and version: MacOS Sequoia 15.1.1
  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.15

Code Snippet

NA

Repro Steps

  • When pytest is run from terminal, all tests run as expected (success)
    Image

  • With a small test module, when tests are added one at a time, Pylance discovery succeeds.
    Image

  • BUT, if many test functions are added to a module at once, or several test-modules are added, discovery hangs and fails.
    Image

blue 'loading' bar just goes without end.

Note that there is no message of any kind in Terminal, Output, or Test Results. No error message, no information of any find. App restart is the only way to stop the failing discovery.

This behavior is the same in all projects opened in VSCode

Expected behavior

Tests are discovered

Actual behavior

Discovery fails (hangs and never resolves).

Logs

Attached. This is the log produced when I click on the Testing button in the Activity Bar
OUTPUT_PYTHON_TRACE.txt

2025-01-01 15:37:21.743 [info] Starting Pylance language server.
2025-01-01 15:37:21.745 [debug] Found cached env for /Users/em/Dropbox/bldgtyp-00/00_PH_Tools/honeybee_ph/.venv/bin/python
2025-01-01 15:37:21.746 [debug] Terminal shell path '/bin/zsh' identified as shell 'zsh'
2025-01-01 15:37:21.746 [debug] Shell identified as zsh 
2025-01-01 15:37:21.746 [debug] Found cached env for /Users/em/Dropbox/bldgtyp-00/00_PH_Tools/honeybee_ph/.venv/bin/python
2025-01-01 15:37:27.942 [debug] Found cached env for /Users/em/Dropbox/bldgtyp-00/00_PH_Tools/honeybee_ph/.venv/bin/python
2025-01-01 15:37:27.943 [debug] Found cached env for /Users/em/Dropbox/bldgtyp-00/00_PH_Tools/honeybee_ph/.venv/bin/python
2025-01-01 15:38:34.005 [debug] Found cached env for /Users/em/Dropbox/bldgtyp-00/00_PH_Tools/honeybee_ph/.venv/bin/python
2025-01-01 15:39:01.188 [debug] Found cached env for /Users/em/Dropbox/bldgtyp-00/00_PH_Tools/honeybee_ph/.venv/bin/python
2025-01-01 15:39:04.339 [debug] Found cached env for /Users/em/Dropbox/bldgtyp-00/00_PH_Tools/honeybee_ph/.venv/bin/python

Note the last line continues to update and adds another identical line every 30-40 seconds.

@paulomulotto
Copy link

paulomulotto commented Jan 2, 2025

Same problem here. I couldn't find any solution to it :/

@ceorcham
Copy link

ceorcham commented Jan 2, 2025

This is python extension issue, you can make test discovery to work again by downgrading the VSCode python extension to 2024.22.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants