Skip to content

pytest_bdd_apply_tag does not detect Gherkin example tags #774

Description

@calgray

Is your feature request related to a problem? Please describe.
Tags on example tables are not picked up by the pytest_bdd_apply_tag.

i.e.

Feature: My Feature
    Scenario: My scenario case <case>
    
    Examples:
        | case |
        | 1    |
        | 2    |

    @xfail @supresswarning=DeprecationWarning
    Examples:
        | case |
        | 3    |

case 3 does get marked with xfail, but pytest_bdd_apply_tag never sees either tag.

Describe the solution you'd like
All tag locations supported by Gherkin features are intercepted by the tag hook.

Describe alternatives you've considered
Use custom tags on the entire scenario
Use @xfail and @skip tags without specifying a reason
Use request.node.add_marker() in relevent python steps that can branch on example parameters

Additional context
@skip and @xfail are working for example tables, but they and new tags can't be customised.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions