You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromgherkin.parserimportParserfromgherkin.pickles.compilerimportCompilerfeature="""\Feature: Outline Scenario Outline: Outlined with duplicated parameter example table Given there are <start> cucumbers When I eat <eat> cucumbers Then I should have <left> cucumbers Examples: | start | start | left | | 12 | 10 | 7 | | 2 | 1 | 1 |"""gherkin_ast_data=Parser().parse(feature)
gherkin_ast_data["uri"]='uri'try:
pickles_data=Compiler().compile(gherkin_ast_data)
exceptException:
passelse:
raiseRuntimeError('Pickles were loaded and are broken')
Note: This ticket highlights two issues at once. I would strongly suggest treating these separately or the fix for the first will get bogged down in the discussion of the second.
Duplicated columns.
The duplicated start columns are unambiguously wrong and should result in error.
A substitution pattern <eat> that is not replaced.
Because of the way Gherkin has been defined I don't see any way of fixing this. We can not tell the difference between a substitution pattern or accidental Gherkin. For example:
Then the "temperature<6" and "humidity>12" is displayed
π What did you see? - Pickle compiled without error from AST containing invalid example data
β What did you expect to see? - Pickle compilation fails on invalid incoming data from AST
π¦ Which tool/library version are you using? - https://pypi.org/project/gherkin-official/23.0.1/
π¬ How could we reproduce it?
π Any additional context?
This text was originally generated from a template, then edited by hand. You can modify the template here.
The text was updated successfully, but these errors were encountered: