Skip to content

Class nodes missing for parameterized tests #21541

Closed

Description

class nodes are not showing up for parameterized tests- instead they all just sit under the file node.

Screenshot 2023-06-29 at 3 13 46 PM

Activity

  1. added
    bug
    on Jun 29, 2023
  2. added
    triage-needed
    on Jun 29, 2023
  3. eleanorjboyd commented on Jun 29, 2023

    @eleanorjboyd
    Author

    verification steps:

    1. get file with parameterize tests
    2. discover tests via the testing panel, do it for pytest
    3. install pytest if you don't have it (python -m pip install pytest)
    4. create a file with two classes or parameterized tests (or use example below)
    5. confirm nodes for the two classes appear which the parameterized tests sit under (so a test_odd_even node with 1,2,3,4,5 under it)
    import pytest
    import time
    
    
    # Testing pytest with parametrized tests. The first two pass, the third fails.
    # The tests ids are parametrize_tests.py::test_adding[3+5-8] and so on.
    @pytest.mark.parametrize(
        "actual, expected",
        [("3+3", 5), ("2+3", 6), ("6+9", 16)],
        ids=["test adding", "2      +V", "\n ffda"],
    )
    def test_adding(actual, expected):
        assert eval(actual) == expected
    
    
    @pytest.mark.parametrize("num", range(1, 5))
    def test_odd_even(num):
        time.sleep(0.3)
        assert num < 10
    
  4. locked as resolved and limited conversation to collaborators on Jul 31, 2023
  5. added 2 commits that reference this issue on Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-testingbugtriage-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions