Skip to content

Python unittests: Error is displayed in the Test Log Output after tests run #20705

@MichaelXt

Description

@MichaelXt

Type: Bug

Error is displayed after unit tests run.

Behaviour

Expected: tests run, issues reported.
Actual: tests run, but Python test log contains following error:

----------------------------------------------------------------------
Ran 1 test in 0.002s

OK
ERROR conda.cli.main_run:execute(47): `conda run python /home/mikl/.vscode-server/extensions/ms-python.python-2023.2.0/pythonFiles/get_output_via_markers.py /home/mikl/.vscode-server/extensions/ms-python.python-2023.2.0/pythonFiles/visualstudio_py_testlauncher.py --us=./scripts --up=*test*.py --uvInt=2 --result-port=34779 -tpp_test.GetChangeOfBasisMatrixTests.test_get_change_of_basis_matrix --testFile=/home/mikl/proj/pp_test.py` failed. (See above for error)

Running the command manually in terminal results in following log:

conda run python /home/mikl/.vscode-server/extensions/ms-python.python-2023.2.0/pythonFiles/get_output_via_markers.py /home/mikl/.vscode-server/extensions/ms-python.python-2023.2.0/pythonFiles/visualstudio_py_testlauncher.py --us=./scripts --up=*test*.py --uvInt=2 --result-port=34779 -tpp_test.GetChangeOfBasisMatrixTests.test_get_change_of_basis_matrix --testFile=/home/mikl/pickerPlanner/scripts/pp_test.py
>>>PYTHON-EXEC-OUTPUT
<<<PYTHON-EXEC-OUTPUT

Traceback (most recent call last):
  File "/home/mikl/.vscode-server/extensions/ms-python.python-2023.2.0/pythonFiles/get_output_via_markers.py", line 26, in <module>
    runpy.run_path(module, run_name="__main__")
  File "/home/mikl/miniconda3/lib/python3.10/runpy.py", line 289, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/home/mikl/miniconda3/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/home/mikl/miniconda3/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/mikl/.vscode-server/extensions/ms-python.python-2023.2.0/pythonFiles/visualstudio_py_testlauncher.py", line 404, in <module>
    main()
  File "/home/mikl/.vscode-server/extensions/ms-python.python-2023.2.0/pythonFiles/visualstudio_py_testlauncher.py", line 289, in main
    socket.create_connection(("127.0.0.1", opts.result_port)), stopTests
  File "/home/mikl/miniconda3/lib/python3.10/socket.py", line 845, in create_connection
    raise err
  File "/home/mikl/miniconda3/lib/python3.10/socket.py", line 833, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

ERROR conda.cli.main_run:execute(47): `conda run python /home/mikl/.vscode-server/extensions/ms-python.python-2023.2.0/pythonFiles/get_output_via_markers.py /home/mikl/.vscode-server/extensions/ms-python.python-2023.2.0/pythonFiles/visualstudio_py_testlauncher.py --us=./scripts --up=*test*.py --uvInt=2 --result-port=34779 -tpp_test.GetChangeOfBasisMatrixTests.test_get_change_of_basis_matrix --testFile=/home/mikl/pickerPlanner/scripts/pp_test.py` failed. (See above for error)

Steps to reproduce:

  1. Run standard python unittests in WSL ubuntu 22.04. Python env is created via miniconda.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.9.16
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

test_get_change_of_basis_matrix (pp_test.GetChangeOfBasisMatrixTests) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.002s

OK
ERROR conda.cli.main_run:execute(47): `conda run python /home/mikl/.vscode-server/extensions/ms-python.python-2023.2.0/pythonFiles/get_output_via_markers.py /home/mikl/.vscode-server/extensions/ms-python.python-2023.2.0/pythonFiles/visualstudio_py_testlauncher.py --us=./scripts --up=*test*.py --uvInt=2 --result-port=34779 -tpp_test.GetChangeOfBasisMatrixTests.test_get_change_of_basis_matrix --testFile=/home/mikl/pickerPlanner/scripts/pp_test.py` failed. (See above for error)

User Settings


languageServer: "Pylance"

formatting
• provider: "yapf"

testing
• unittestArgs: "<placeholder>"
• unittestEnabled: true

Extension version: 2023.2.0
VS Code version: Code 1.75.1 (441438abd1ac652551dbe4d408dfcec8a499b8bf, 2023-02-08T21:32:34.589Z)
OS version: Windows_NT x64 10.0.22000
Modes:
Sandboxed: No
Remote OS version: Linux x64 5.15.79.1-microsoft-standard-WSL2

System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i9-12900H (20 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) 31.71GB (20.13GB free)
Process Argv --folder-uri vscode-remote://wsl%2Bubuntu-22.04/home/mikl/pickerPlanner --crash-reporter-id d1eb50a0-7af2-4be0-b087-6fc7337228aa
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu-22.04
OS Linux x64 5.15.79.1-microsoft-standard-WSL2
CPUs 12th Gen Intel(R) Core(TM) i9-12900H (20 x 2918)
Memory (System) 15.48GB (13.66GB free)
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
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vscaac:30438847
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
azure-dev_surveyone:30548225
vscccc:30610679
pyindex848:30662994
nodejswelcome1cf:30587006
2e4cg342:30602488
pyind779cf:30662993
f6dab269:30613381
pythonsymbol12cf:30657549
a9j8j154:30646983
vsccsb:30662443

Metadata

Metadata

Assignees

Labels

area-testinginfo-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