Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test provider types are not aligned #24926

Open
LutingWang opened this issue Mar 22, 2025 · 5 comments
Open

Test provider types are not aligned #24926

LutingWang opened this issue Mar 22, 2025 · 5 comments
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@LutingWang
Copy link

LutingWang commented Mar 22, 2025

Type: Bug

Behaviour

When opening a python workspace, the TESTING panel is as below:

Image

Running pytest from the terminal is ok:

Image

Steps to reproduce:

  1. git clone https://github.com/LutingWang/todd.git
  2. cd todd
  3. pip install .[test]
  4. Open the todd repository with vscode and python extension.

Diagnostic data

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

2025-03-22 13:38:47.254 [info] Native locator: Refresh started
2025-03-22 13:38:47.254 [error] Python discovery not supported in untrusted workspace
2025-03-22 13:38:47.254 [info] Native locator: Refresh finished in 8 ms
2025-03-22 13:38:47.486 [error] Python discovery not supported in untrusted workspace
2025-03-22 13:38:47.486 [error] Invalid environment [native]: {}
2025-03-22 13:38:49.289 [info] Starting Pylance language server.
2025-03-22 13:39:09.567 [info] Native locator: Refresh started
2025-03-22 13:39:09.623 [info] Pyenv environment manager found at: /data/wlt/.pyenv/bin/pyenv
2025-03-22 13:39:09.639 [info] Conda environment manager found at: /opt/conda/bin/conda
2025-03-22 13:39:09.639 [info] Using conda: /opt/conda/bin/conda
2025-03-22 13:39:09.659 [info] Native locator: Refresh finished in 107 ms
2025-03-22 13:39:32.137 [info] Native locator: Refresh started
2025-03-22 13:39:32.137 [info] Native locator: Refresh started
2025-03-22 13:39:32.169 [info] Pyenv environment manager found at: /data/wlt/.pyenv/bin/pyenv
2025-03-22 13:39:32.330 [info] Python interpreter path: ~/.local/share/virtualenvs/todd-EBkXfio_/bin/python
2025-03-22 13:39:32.337 [info] Conda environment manager found at: /opt/conda/bin/conda
2025-03-22 13:39:32.337 [info] Conda set to: /opt/conda/bin/conda
2025-03-22 13:40:24.859 [info] Native locator: Refresh finished in 52721 ms
2025-03-22 13:40:24.867 [info] > ~/.pyenv/bin/pyenv which python
2025-03-22 13:40:24.867 [info] cwd: .
2025-03-22 13:40:24.880 [info] Discover tests for workspace name: todd - uri: /data/wlt/projects/todd
2025-03-22 13:40:24.880 [error] Test provider in adapter is not pytest. Please reload window.
2025-03-22 13:40:25.322 [info] > /opt/conda/bin/conda info --json

Extension version: 2025.2.0
VS Code version: Code 1.98.2 (Universal) (ddc367ed5c8936efe395cffeec279b04ffd7db78, 2025-03-12T13:32:45.399Z)
OS version: Darwin arm64 24.3.0
Modes:
Connection to 'ssh-remote+jump_colab26_ov' could not be established

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


languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true
• unittestEnabled: true

experiments
• enabled: false
• optOutFrom: ["pythonTestAdapter"]

Installed Extensions
Extension Name Extension Id Version
autopep8 ms- 2025.2.0
black-formatter ms- 2025.2.0
cmake twx 0.0.17
cmake-language-support-vscode jos 0.0.9
cmake-tools ms- 1.20.53
code-spell-checker str 4.0.40
copilot Git 1.288.0
copilot-chat Git 0.25.1
cpptools ms- 1.23.6
cpptools-extension-pack ms- 1.3.1
debugpy ms- 2025.4.1
doxdocgen csc 1.4.0
flake8 ms- 2025.2.0
gitlens eam 16.3.3
intellicode-api-usage-examples Vis 0.2.9
isort ms- 2023.10.1
js-debug ms- 1.97.1
jupyter ms- 2025.2.0
jupyter-renderers ms- 1.1.0
latex-workshop Jam 10.8.0
live-server ms- 0.4.15
makefile-tools ms- 0.12.17
mypy-type-checker ms- 2025.2.0
nsight-vscode-edition nvi 2024.1.34572442
pylint ms- 2025.2.0
python ms- 2025.2.0
vscode-django bat 1.15.0
vscode-docker ms- 1.29.4
vscode-dotnet-runtime ms- 2.2.8
vscode-github-issue-notebooks ms- 0.0.130
vscode-js-profile-table ms- 1.0.10
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-leetcode Lee 0.18.4
vscode-markdownlint Dav 0.59.0
vscode-pylance ms- 2025.3.2
vscode-wakatime Wak 25.0.0
vscode-yaml red 1.17.0
vscodeintellicode Vis 1.3.2
yapf eey 2024.12.104094746
System Info
Item Value
CPUs Apple M4 (10 x 2400)
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.26GB free)
Process Argv --crash-reporter-id 674517c1-1401-480d-9367-fcaabadcfe74
Screen Reader no
VM 0%

Connection to 'ssh-remote+jump_colab26_ov' could not be established

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupytercf:31046870
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc1:31192215
iacca1:31171482
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
9064b325:31222308
copilot_t_ci:31222730
f27dg485:31264363
968h8231:31262364
jda6j935:31233686
pythoneinst12cf:31262606
bgcontrol:31262794
fh1c7952:31258891
4gafe986:31264396
563cc122:31253270
31787653:31262186
3e8i5726:31266632
80860236:31264450
49da9784:31264548

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Mar 22, 2025
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug area-testing labels Mar 26, 2025
@eleanorjboyd
Copy link
Member

Hi! If you reload your vs code window it should fix the problem. You can find a command to do so in the command palette "developer: refresh window"

@Saran33
Copy link

Saran33 commented Mar 28, 2025

Facing the same issue. "developer: relaod window" doesn't resolve it for me. In one of my workspaces, the "Python tests" tab is duplicated, with one working and one showing the above error message. In another workspace, it's the exact same error as above (with no duplicate tab)

@grumBit
Copy link

grumBit commented Mar 28, 2025

I'm also having the same problem. Running "developer: reload window" didn't help either.

@grumBit
Copy link

grumBit commented Mar 28, 2025

After messing about in settings.json, I got it to work by setting "python.testing.unittestEnabled": false (it had been true).

These are all the settings related to testing in my settings.json;

  "python.analysis.enablePytestExtra": true,
  "python.analysis.enablePytestSupport": true,
  "python.testing.pytestEnabled": true,
  "python.testing.unittestEnabled": false,
  "testing.automaticallyOpenPeekView": "never",
  "testing.defaultGutterClickAction": "debug",

I'm guessing the last two have no impact on this problem. However, I've no idea how the first four may interact with one another. All I do know is setting unittestEnabled to false got it working on my machine.

@eleanorjboyd
Copy link
Member

Hi! For these two settings- one must always be true while the other is false, maybe thats why it helped in your scenario?

"python.testing.pytestEnabled": true,
  "python.testing.unittestEnabled": false,

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

5 participants