gabrielfalcao / lettuce

Behavior-driven-development tool for python, inspired by Cucumber for Ruby ⛺
http://lettuce.it
GNU General Public License v3.0
1.27k stars 325 forks source link

Properly set step.failed/passed in StepDefinition #553

Closed mhaas closed 5 years ago

mhaas commented 7 years ago

In some corner cases, step.failed and step.passed can simultaneously be true. This is obviously an error.

This commit forces step.passed to False in case of failure and step.failed to False in case of success.

I assume the conditions for the corner case revolve around outline support, where a step is cloned and may possibly inherit the passed flag from a previous run. But that's just conjecture, I did not trace this completely.

Finally, step.behave_as always sets both step.failed and step.passed, so StepDefinition probably should do the same.

I am currently unable to install all dependencies for testing, but I assume there is a CI setup for this repository.