microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.28k stars 1.17k forks source link

pytest discovery broken - no pip installer #22637

Closed Josverl closed 8 months ago

Josverl commented 8 months ago

Type: Bug

Test discovery in existing project stopped working

Extension version: 2023.22.0 VS Code version: Code 1.85.0 (af28b32d7e553898b2a91af498b1fb666fdebe0c, 2023-12-06T20:48:09.019Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz (8 x 3302)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.84GB (6.73GB free)| |Process Argv|. --crash-reporter-id fc4aff2e-75bc-4485-b49b-a6ef380bc8c6| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30410667 py29gd2263:30899288 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 azure-dev_surveyone:30548225 2e4cg342:30602488 f6dab269:30613381 showlangstatbar:30737416 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 welcomedialog:30910333 pythonnosmt12:30797651 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixt:30902429 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 accentitlementst:30887150 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 aa_t_chat:30882232 ```
Josverl commented 8 months ago

Using the preview version v2023.23.13391009 the Output.Python log shows :

2023-12-12 23:24:22.657 [info] > ./.venv/Scripts/activate.bat && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2023.23.13391009/pythonFiles/printEnvVariables.py
2023-12-12 23:24:22.657 [info] shell: commandPrompt
2023-12-12 23:24:22.823 [info] > .\.venv -m pytest -p vscode_pytest --collect-only .
2023-12-12 23:24:22.823 [info] cwd: .
2023-12-12 23:24:29.440 [info] Discover tests for workspace name: micropython-stubber - uri: c:\develop\MyPython\micropython-stubber
2023-12-12 23:24:29.440 [info] Running discovery for pytest using the new test adapter.
2023-12-12 23:24:33.788 [info] Discover tests for workspace name: micropython-stubber - uri: c:\develop\MyPython\micropython-stubber
2023-12-12 23:24:33.788 [info] Running discovery for pytest using the new test adapter.
2023-12-12 23:24:37.293 [info] > ./.venv/Scripts/activate.bat && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2023.23.13391009/pythonFiles/printEnvVariables.py
2023-12-12 23:24:37.294 [info] shell: commandPrompt
2023-12-12 23:24:37.426 [info] > .\.venv -c "import pytest"
2023-12-12 23:24:37.431 [info] > conda info --json
2023-12-12 23:24:38.351 [error] Error in worker c:\Users\josverl\.vscode\extensions\ms-python.python-2023.23.13391009\out\client\registryKeys.worker.js TypeError [Error]: Cannot read properties of null (reading 'map')
    at c:\Users\josverl\.vscode\extensions\ms-python.python-2023.23.13391009\out\client\registryKeys.worker.js:1:7884
    at ChildProcess.<anonymous> (c:\Users\josverl\.vscode\extensions\ms-python.python-2023.23.13391009\out\client\registryKeys.worker.js:1:3775)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at ChildProcess._handle.onexit (node:internal/child_process:302:5)
2023-12-12 23:24:38.816 [info] > .\.venv -c "import pip"
2023-12-12 23:24:54.822 [info] Discover tests for workspace name: micropython-stubber - uri: c:\develop\MyPython\micropython-stubber
2023-12-12 23:24:54.822 [info] Running discovery for pytest using the new test adapter.
eleanorjboyd commented 8 months ago

Hi! This looks like a duplicate of this issue https://github.com/microsoft/vscode-python/issues/22618, we have just released a fix to insiders and will release to stable later today. Thanks