Skip to content

pytest test discovery not working #25472

@radu-ion

Description

@radu-ion

Type: Bug

Behaviour

Test discovery in folder 'tests' ends with this error message:

2025-09-19 11:46:07.380 [info] Native locator: Refresh started
2025-09-19 11:46:07.380 [info] Native locator: Refresh started
2025-09-19 11:46:07.501 [info] Native locator: Refresh finished in 121 ms
2025-0
9-19 11:46:07.508 [info] > pyenv which python
2025-09-19 11:46:07.508 [info] cwd: .
2025-09-19 11:46:07.528 [info] Active interpreter [e:\Temp\test_problem]: C:\Program Files\Python312\python.exe
2025-09-19 11:46:07.530 [info] Starting Pylance language server.
2025-09-19 11:46:13.475 [info] Discover tests for workspace name: test_problem - uri: e:\Temp\test_problem
2025-09-19 11:46:13.476 [warning] The cwd resolves to a different path, checking if it has a symbolic link somewhere in its path.
2025-09-19 11:46:13.477 [info] Environment variables set for pytest discovery: PYTHONPATH=c:\Users\ionra.vscode\extensions\ms-python.python-2025.14.0-win32-x64\python_files, TEST_RUN_PIPE=\.\pipe\python-test-discovery-aeac70e13732cd3eded9
2025-09-19 11:46:13.493 [error] Subprocess exited unsuccessfully with exit code null and signal null on workspace e:\Temp\test_problem
2025-09-19 11:46:13.493 [error] pytest test discovery error for workspace: e:\Temp\test_problem

The python test process was terminated before it could exit on its own, the process errored with: Code: null, Signal: null for workspace e:\Temp\test_problem

Steps to reproduce:

  1. Create an empty folder with any test case in the 'tests' folder.
  2. Click on the testing icon in the left toolbar of VS Code.
  3. See the output of test discovery.

Or you can try with the attached project.
test_problem.zip

Extension version: 2025.14.0
VS Code version: Code 1.104.1 (0f0d87fa9e96c856c5212fc86db137ac0d783365, 2025-09-17T23:36:24.973Z)
OS version: Windows_NT x64 10.0.26100
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.7
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
autopep8 ms- 2025.2.0
cmake-tools ms- 1.21.36
cpptools ms- 1.27.7
cpptools-extension-pack ms- 1.3.1
cpptools-themes ms- 2.0.0
debugpy ms- 2025.10.0
docker doc 0.17.0
intellicode-api-usage-examples Vis 0.2.9
isort ms- 2025.0.0
java red 1.45.0
js-debug ms- 1.104.0
js-debug-companion ms- 1.1.3
python ms- 2025.14.0
remote-containers ms- 0.427.0
remote-wsl ms- 0.104.2
vscode-containers ms- 2.1.0
vscode-docker ms- 2.0.0
vscode-gradle vsc 3.17.0
vscode-java-debug vsc 0.58.2
vscode-java-dependency vsc 0.24.1
vscode-java-pack vsc 0.29.2
vscode-java-test vsc 0.43.1
vscode-js-profile-table ms- 1.0.10
vscode-maven vsc 0.44.0
vscode-pylance ms- 2025.8.2
vscode-python-envs ms- 1.8.0
vscodeintellicode Vis 1.3.2
xml Dot 2.5.1
System Info
Item Value
CPUs Intel(R) Core(TM) i9-14900K (32 x 3187)
GPU Status 2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 127.79GB (104.94GB free)
Process Argv --crash-reporter-id c3e6123c-0326-4a4a-abe1-126bd33ddb9e
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
996jf627:31283433
pythonrdcb7:31342333
usemplatestapi:31297334
aj953862:31281341
nesew2to5:31336538
cs4_fixed:31388788
nes-set-on:31351930
6abeh943:31336334
envsactivate1:31353494
0927b901:31350571
ovs_t:31383295
editstats-enabled:31346257
aa_t:31379598
0cj2b977:31352657
0574c672:31362109
cloudbuttont:31379625
todos-1:31384886
codex-prompt:31370221
multireplacestringcontrol:31387919
control_gpt5applypatchexclusively:31387916
3efgi100_wstrepl:31382709
metis-embeddings:31388492
trigger-command-fix:31379601
auto_model_enabled:31385282

Metadata

Metadata

Assignees

No one assigned

    Labels

    info-neededIssue requires more information from postertriage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions