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

pytest parametrize test results are hard to read #24383

Open
okken opened this issue Nov 4, 2024 · 0 comments
Open

pytest parametrize test results are hard to read #24383

okken opened this issue Nov 4, 2024 · 0 comments
Assignees
Labels
area-testing triage-needed Needs assignment to the proper sub-team

Comments

@okken
Copy link

okken commented Nov 4, 2024

Type: Bug

Behaviour

With parametrized tests, the results are hard to read in the "running tests for ..." right side window of test results.
For non-parametrized tests, the test name is listed.
For parametrized tests, the parameters are listed without the test name.
I think it would be easier to read if it was "test_name[param_value]", similar to how pytest -v shows the results.

Steps to reproduce:

Run a test with parametrizations.
Here's a small example:

import pytest

def test_a_1():
    ...

def test_a_2():
    ...

@pytest.mark.parametrize('x', [1, 2])
def test_b(x):
    ...

I'm attaching a screen shot of the output to demo the issue.
In this example I think "test_b[1]" and "test_b[2]" would be easier to read than "[1]" and "[2]".
Image

The problem is more pronounced with a parametrized fixture.
Example:

import pytest

@pytest.fixture(params=[1, 2])
def x(request):
    return request.param

def test_a(x):
    ...

def test_b(x):
    ...

Results in:
Image

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: 2024.18.0
VS Code version: Code 1.95.1 (65edc4939843c90c34d61f4ce11704f09d3e5cb6, 2024-10-31T05:14:54.222Z)
OS version: Windows_NT x64 10.0.22631
Modes:

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants