-
Notifications
You must be signed in to change notification settings - Fork 234
Description
The documentation of pytest-bdd states that "Gherkin scenario outlines are supported by pytest-bdd exactly as it's described in be behave docs". However, there is one situation in which the support for scenario outlines is different from what behave supports.
Sometimes, when defining a scenario outline, it is useful to include additional columns in the "Examples" table, which are not referenced in any step definition - for documentation purposes, or to specify values that are not needed now, but will be used later. If you do this in behave, it correctly ignores such columns. However, if you do it in pytest-bdd an error is thrown.
For example, I have a scenario outline where the examples table contains the columns servicestring, errorMsg, logMsg and note - note being a column that is purely there for documentation purposes. The first three columns are referenced by step definitions, but note is not and should not be. When I run this test, I get the error:
Scenario "..." in the feature "..." has not valid examples. Set of step parameters ['errorMsg', 'logMsg', 'servicestring'] should match set of example values ['errorMsg', 'logMsg', 'note', 'servicestring'].
It might be that there is a way to overcome this through configuration, but if so it isn't clearly documented so it effectively isn't available. (And from looking at the code, it doesn't appear that there is.) If there isn't a way to overcome it, it is a serious error.