Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scenario descriptions cause odd results #311

Closed
rcasperson-jc opened this issue Jul 22, 2019 · 4 comments · Fixed by #600 · May be fixed by #312
Closed

Scenario descriptions cause odd results #311

rcasperson-jc opened this issue Jul 22, 2019 · 4 comments · Fixed by #600 · May be fixed by #312

Comments

@rcasperson-jc
Copy link

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.

@youtux
Copy link
Contributor

youtux commented Jul 23, 2019

Hey @rcasperson-jc, thanks for the report. Would you be interested in trying to fix it and make a pull request?

@rcasperson-jc
Copy link
Author

@youtux I'd certainly be happy to, and I may have the time to do so. If/when I start work on it, I'll make it known on this issue.

@youtux
Copy link
Contributor

youtux commented Jul 23, 2019

Cool, thanks! 👍

rbcasperson added a commit to rbcasperson/pytest-bdd that referenced this issue Jul 25, 2019
fixes pytest-dev#311

This treats scenario descriptions the same way it does
feature descriptions.
@rbcasperson
Copy link

I've got a PR open for this. @youtux hopefully you or someone can take a look at it soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants