Skip to content

V2: Align case functions with parametrize_plus/fixture_ref experience #90

@smarie

Description

@smarie

Now that parametrize_plus fully supports fixture_ref and pytest.param, we should be able to fully uniformize the experience provided in "case functions" with the experience of parametrize_plus:

  • passing ids and marks should be similar/aligned.

    • For single case functions: as of now we have a @case_name decorator to customize the id, and on the other hand case functions can be decorated with @pytest.mark. Should we simply rename @case_name into @case_id for consistency with pytest ? Or provide a function similar to pytest.param to be able to customize both id and mark at the same time ? (@case_marks(id=..., marks=...)). EDIT better: provide a simple @case decorator to customize name/id and marks

    • For case generators, there is probably no need any more to have a different way to generate their names than the ids parameter from pytest. Or if so, it should be an additional helper, not an alternate engine.

  • what about the lru_cache mechanism then ?

  • a case function should be able to require a fixture, see Allow case functions to require a fixture #56

etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions