-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Step is not found when the py script with @step function is imported by another script #8
Comments
Run the same code on my Windows machie, it shows: Looks like |
Ok I think I have found the root cause. |
@kbfu I think the root cause you have found is the right one. But we cannot remove the duplicate step implementation because Gauge skips a scenario which has a step with multiple step implementation. And if we remove the duplicate one, then Gauge will never know that there was duplicate step implementation found which will result in inconsistent behaviour between different languages supported by Gauge. The ideal solution would be to not import the file twice and that responsibility lies with the python runner. Currently, I am not sure how will we implement it. Thoughts? |
Hey @kashishm , |
@kashishm Thanks, it works. |
Hi,
I was running my gauge python code, and I found a problem.
Let's say there is an a.py, it has an
@step
decorator like below:And there is another script, let's say b.py that imports a.py as below:
Now let's run the gauge spec as below shows:
, it will throw ValidationError because it cannot find
@step('run a')
.The workaround is if I want to use the function in a.py, I must import it inside a function in b.py instead of importing it globally.
Console output as below:
Python: 3.5.2
[ValidationError] /Users/xxx/Documents/xxx/specs/1.spec:7: 1 => 'run a'
The text was updated successfully, but these errors were encountered: