Skip to content

pytest List view shows parameter as test name instead of the test name #25458

@y2kbugger

Description

@y2kbugger

Type: Bug

Behaviour

When discovering parametrized tests, The list view Bolds and moves to the left the value of the param, instead of the name of the test (perhaps with the param value)

[6] y2k-lc3-tools > y2klc3tools > vm_test.py > test_ADD

instead of

test_ADD[6] y2k-lc3-tools > y2klc3tools > vm_test.py

Steps to reproduce:

create an example pytest file

import pytest


@pytest.mark.parametrize(
    "input,expected",
    [
        (6, 7),
        (7, 8),
        (7, 3),
        (8, 9),
        (9, 11),
    ],
)
def test_addone(input, expected):
    assert input + 1 == expected
Image

And just to show it in context with my current project, where I am using a parametrized (sic) fixture to compare two implementations of a VM, it obscures the name of the actual test unless i make the test explorer very wide.

Image

And wanted to share that I have never noticed this before because i normally stick to tree view. But now I am just want to filter on "@failed" and when there are only a few, i'd like to use the list view:

Image

because otherwise it is hard to interpret all the red lines at a glance, e.g. folder vs file, vs test vs parameter. but actually there is only one failing test.

Image

That leads me to think: maybe you should bold the test name in the tree view as well, and leave the rest of the structure as is.

Diagnostic data

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

XXX

Extension version: 2025.12.0
VS Code version: Code 1.103.2 (6f17636121051a53c88d3e605c491d22af2ba755, 2025-08-20T16:45:34.255Z)
OS version: Linux x64 6.16.5-arch1-1
Modes:

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


languageServer: "Pylance"

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

Installed Extensions
Extension Name Extension Id Version
copilot Git 1.368.0
copilot-chat Git 0.30.3
debugpy ms- 2025.10.0
hexeditor ms- 1.11.1
js-debug ms- 1.102.0
js-debug-companion ms- 1.1.3
jupyter ms- 2025.7.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.3.0
markdown-table-editor oct 0.0.6
pdf tom 1.2.2
python ms- 2025.12.0
remote-explorer ms- 0.5.0
remote-server ms- 1.5.2
ruff cha 2025.26.0
synthwave-80s-color-theme san 2.0.0
trailing-spaces sha 0.4.1
vim vsc 1.30.1
vscode-js-profile-table ms- 1.0.10
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-pylance ms- 2025.7.1
vscode-python-envs ms- 1.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-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