@precondition tag in feature file throwing RecursionError maximum recursion depth exceeded when parsing Scenario from same feature file
See original GitHub issueOS: macOS Sierra (10.12.5) Python version: 3.5.1 radish-bdd version: 0.6.3
I am writing a feature file which would greatly benefit from the functionality of the @precondition scenario tag described in the documentation as follows:
“”" Feature: My Awesome Feature In order to document radish I write this feature. @precondition (SomeFeature.feature: An awesome Scenario) Scenario: Do some crazy stuff When I add the following users to the database | Sheldon | Cooper | Then I expect to have 1 user in the database “”"
I am writing a feature file (for example’s sake, call it MyFeature.feature) as follows:
Feature: MyFeature
...
@tag1
Scenario: First Scenario
...
steps 1
...
@tag2
@precondition(Myfeature.feature: First Scenario)
Scenario: Second Scenario which depends on the executions of First Scenario
...
steps 2
...
When running radish on this feature file (from a bash script where $1 is the feature file name):
radish features/$1.feature --basedir src/steps/ --cucumber-json cucumber.json --write-steps-once
File "lib/python3.5/site-packages/radish/parser.py", line 177, in _parse_context
return parse_context_func(line)
File "lib/python3.5/site-packages/radish/parser.py", line 343, in _parse_step
return self._parse_scenario(line)
File "lib/python3.5/site-packages/radish/parser.py", line 250, in _parse_scenario
scenario = self._parse_precondition(tag[1])
File "lib/python3.5/site-packages/radish/parser.py", line 419, in _parse_precondition
feature = self._core.parse_feature(feature_file, self._tag_expr)
File "lib/python3.5/site-packages/radish/core.py", line 100, in parse_feature
feature = featureparser.parse()
File "lib/python3.5/site-packages/radish/parser.py", line 148, in parse
result = self._parse_context(line)
RecursionError: maximum recursion depth exceeded while calling a Python object
And the stack trace repeats and blows up my terminal stdout until finally RecursionError is thrown and it exits
I can confirm that it is the parsing of the @precondition scenario which causes this error, since removing that scenario (or at least, removing the ‘@precondition’ tag) resolves the error. NOTE: It is also necessary for @tag1 and @tag2 to be in the feature file as those tags need to be in the cucumber report which radish will output. I tried removing the @tag1 and @tag2 tags and nothing changed.
However, on that note, are multiple tags supported for radish in feature files? I did not find an answer in the documentation, so I figure it’s good to ask here. Please advise how I could fix this @precondition scenario
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (7 by maintainers)

Top Related StackOverflow Question
Thanks to the new parser in the master branch, this is resolved. See integration tests:
Yeah, I’ve completely forgot to address this issue as well. I’ll have a look at it and hope to have a fix soon.
🍻