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 Explorer is not displaying the tests with :: correctly #7961

Open
StellaHuang95 opened this issue Jul 25, 2024 · 1 comment
Open

Test Explorer is not displaying the tests with :: correctly #7961

StellaHuang95 opened this issue Jul 25, 2024 · 1 comment
Assignees
Labels

Comments

@StellaHuang95
Copy link
Contributor

Steps to Reproduce

  1. Install the python workload.
  2. Create a python project.
  3. Set up the python environment, install pytest to the environment.
  4. Go to project properties and set the test framework to pytest
  5. Add a new python file test_1.py and add the code below to it.
def ischildnode(baseid, nodeid):
    return nodeid.startswith(baseid)

import pytest
@pytest.mark.parametrize(
    "baseid, nodeid, expected",
    [
        ("foo/bar::TestBaz", "foo/bar::TestBop", True),
    ],
)
def test_ischildnode(baseid, nodeid, expected):
    result = ischildnode(baseid, nodeid)
    assert result == expected
  1. Open Test Explorer

Current behavior
image

Expected behavior
-PythonApplication8
-test_1.py
-test_ischildnode[foo/bar::TestBaz-foo/bar::TestBop-True]

@StellaHuang95
Copy link
Contributor Author

See https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2172395

Response from the TE team:
The FullyQualifiedName needs to be in a C#-similar format in order to work in this case. Give that there are embedded '.'s in some of the segments, that probably won't work. I would definitely suggest adding the hierarchy property to all of the test cases, as in the document I linked. It can be completely configurable and won't rely on FQN parsing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants