microsoft / vscode-python

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

Stuck at unittest discovery. #20427

Closed RuofengX closed 1 year ago

RuofengX commented 1 year ago

Type: Bug

Behaviour

Expected vs. Actual

Expected: Testing discovery running fine and show the correct test entry at side bar. Actual: Testing keep loading ,output of Python shows that it stuck at unittest_discovry(or something). Then I run the command, it turns out that there are something wrong with home path:

(.env) PS C:\Users\11986\pycraft-game> .\.env\Scripts\python.exe ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\testing_tools\unittest_discovery.py ./test test_*.py
C:\Users\11986\AppData\Local\Programs\Python\Python311\python.exe: can't open file 'C:\\Users\\11986\\pycraft-game\\~\\.vscode\\extensions\\ms-python.python-2022.20.1\\pythonFiles\\testing_tools\\unittest_discovery.py': [Errno 2] No such file or directory

Steps to reproduce:

  1. Install VSCode
  2. Open the config syncing. (Everything works fine on another windows11 device).
  3. Re-launch VSCode, then open Testing sidebar, configure a unittest setting, then the testing module keeps loading and no response.

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

``` XXX ```

User Settings

``` envFile: "" languageServer: "Pylance" linting • flake8Args: "" • flake8Enabled: true formatting • provider: "black" testing • cwd: "" • unittestArgs: "" • unittestEnabled: true ```

Extension version: 2022.20.1 VS Code version: Code 1.74.2 (e8a3071ea4344d9d48ef8a4df2c097372b0c5161, 2022-12-20T10:29:14.590Z) OS version: Windows_NT x64 10.0.22621 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-1195G7 @ 2.90GHz (8 x 2918)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|15.78GB (8.88GB free)| |Process Argv|--crash-reporter-id 35a92b14-edd7-4c88-a33d-3363e8361a6b| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30410667 cppdebug:30492333 vsclangdc:30486549 c4g48928:30535728 dsvsc012:30540252 azure-dev_surveyone:30548225 pyindex848:30577860 nodejswelcome1:30587005 282f8724:30602487 gswce1:30612156 iaj6b796:30613358 89544117:30613380 fim-prod:30623723 ```
karrtikr commented 1 year ago

Closing as dup of #20426