Skip to content

Parametrized nodeid not matching with parametrized IDs #4142

Open
@vbarbaresi

Description

@vbarbaresi

This is about this issue in pytest-repeat: pytest-dev/pytest-repeat#21

It seems that the bug doesn't come from the plugin: I managed to reproduce with a simple test here.
It affects all pytest versions, at least since 2.8

I wrote a test and a fix attempt here: vbarbaresi@12769f0

The issue is the following: with parametrized IDs and parametrized fixtures, one can't run a test using its node ID with a [parameter] argument

I tracked it down to the x.name vs name matching, which is in my example:
test_foo[1-param] vs test_foo[param]

My fix attempt drops everything after [ on both sides. However, we lose the supplied parameter value so it's not satisfying. I don't know where to fix this properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: parametrizerelated to @pytest.mark.parametrizetopic: selectionrelated to test selection from the command linetype: proposalproposal for a new feature, often to gather opinions or design the API around the new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions