question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@precondition tag in feature file throwing RecursionError maximum recursion depth exceeded when parsing Scenario from same feature file

See original GitHub issue

OS: 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:closed
  • Created 6 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
timofurrercommented, Jun 29, 2017

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.

🍻

Read more comments on GitHub >

github_iconTop Results From Across the Web

RecursionError: maximum recursion depth exceeded in ...
RecursionError is thrown when there are too many function calls on the stack. n == 0 calls a function ( __eq__ ), and...
Read more >
radish-bdd/radish (Raised $0.00) - Issuehunt
@precondition tag in feature file throwing RecursionError maximum recursion depth exceeded when parsing Scenario from same feature file.
Read more >
Getting runtime cucumberexception for error parsing feature file
When I execute feature file where I have written my scenarios, it throws an exception. How to resolve this
Read more >
Hypothesis Documentation - Read the Docs
The text function returns what Hypothesis calls a search strategy. An object with methods that describe how to generate.
Read more >
Release Notes — Qiskit 0.31.0 documentation
Qiskit Metapackage Version qiskit‑terra qiskit‑aer qiskit‑ignis qiskit‑ibmq‑provider Release... 0.34.1 0.19.1 0.10.2 0.7.0 0.18.3 2022‑01... 0.34.0 0.19.1 0.10.1 0.7.0 0.18.3 2021‑12... 0.33.1 0.19.1 0.9.1 0.7.0 0.18.2 2021‑12......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found