Skip to content

Pytest fails for find tests when @parametrize args are sets with multiple values #355

Open
@TheCaffinatedDeveloper

Description

@TheCaffinatedDeveloper

I believe this has something to do with idgen at some point but when you do the following

class SomeCases:
    @parametrize(arg1=[{"set_value_1", "set_value_2"}, {}, {"set_value_1"})
    def case_some_case(arg1: set[str]) -> set[str]:
         return arg1

@parametrize_with_cases("arg", cases=SomeCases)
def test_some_cases(arg: set[str]) -> None:
    assert arg is not None

On the tests that use multiple values within the set, pytest is unable to locate them at run time even though it finds them during collection it seems.

Note: I actually was able to reproduce this within pytest itself when replacing their ids=with lambda x: f"arg1 {str(x)}" so perhaps not a pytest_cases specific issue? Could be another enhancement though :)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions