Skip to content

VS Code test discovery not working with latest conda version 25.5.1 and pytest #780

@afriedma

Description

@afriedma

eleanorjboyd Hi there, I am also running a conda virtual env with version 2025.13.2025082601 Exactly same settings as described in the issue, but in my case, test discovery just hangs forever. Last thing I see in the OUTPUT window is

2025-08-29 05:45:30.392 [info] Discover tests for workspace name: scraping - uri: c:\Users\afriedman\scraping 2025-08-29 05:45:30.395 [warning] The cwd resolves to a different path, checking if it has a symbolic link somewhere in its path. 2025-08-29 05:45:30.398 [info] Environment variables set for pytest discovery: PYTHONPATH=c:\Users\afriedman.vscode\extensions\ms-python.python-2025.13.2025082601-win32-x64\python_files, TEST_RUN_PIPE=.\pipe\python-test-discovery-3d002100b8c820659318

@eleanorjboyd After further investigation, I don't think plugin detects the latest conda version 25.5.1 with pytest. With conda 22.9.0 the output is different as it finds the virtual env, please see below

2025-09-02 07:33:17.086 [info] Environment variables set for pytest discovery: PYTHONPATH=c:\Users\afriedman.vscode\extensions\ms-python.python-2025.12.0-win32-x64\python_files, TEST_RUN_PIPE=\.\pipe\python-test-discovery-ff4ae502f75a2cdf9ca1
2025-09-02 07:33:17.086 [debug] Running pytest discovery with command: -m pytest -p vscode_pytest --collect-only tests --rootdir=c:\Users\afriedman\Development\scraping for workspace c:\Users\afriedman\Development\scraping.
2025-09-02 07:33:17.087 [debug] Found executable within conda env {"name":"scraping_3.11.2","prefix":"C:\Users\afriedman\Miniconda3\envs\scraping_3.11.2"}
2025-09-02 07:33:17.092 [debug] Executable path for pytest discovery: C:\Users\afriedman\Miniconda3\envs\scraping_3.11.2\python.exe.

Originally posted by @afriedma in #508

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions