Skip to content

Scenario descriptions cause odd results #311

@rcasperson-jc

Description

@rcasperson-jc

Perhaps it is not part of pytest-bdd's "subset" of Gherkin, but adding a scenario description causes issues.

Here's a scenario that has a scenario description:

Scenario: Do a thing
    In this scenario we do a thing.
    In this scenario description,
    it can be useful to do some explaining

    Given a thing
    When I do something
    Then something is done

In the above case, pytest-bdd treats each line of the description as a new scenario and creates three extra test cases test_in_this_scenario_we_do_a_thing, test_in_this_scenario_description, and test_it_can_be_useful_to_do_some_explaining and executes them without an error.

It may be easier to just allow scenario descriptions, but at the very least, I'd expect an error saying that the first line of a scenario must be a step.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions