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
Discovery of parameter types and step definitions is currently defined through Behave alphabetically crawling Python modules in the steps directory of an environment, and evaluating each as they are encountered.
As step definitions can be discovered before their referenced parameter types, an UndefinedParameterTypeError can occur - and is more likely when defined in separate modules (alphabetically dependent) compared to in the same modules (hierarchical reference dependent).
However, this may be valid behaviour and there may be performance tradeoffs to consider compared to functionality which is supported as per alternatives defined below.
✨ What's your proposed solution?
The following are potential solutions to this problem:
Discover parameter types first before discovering step definitions
Discover step definitions first, then parameter types; and then evaluate parameter types referenced in step definition patterns
Discover parameter types and step definitions as they are encountered; and then evaluate parameter types referenced in step definition patterns
⛏ Have you considered any alternatives or workarounds?
The following are existing mitigations:
Define parameter types in separate modules and import them into the step definition modules which reference them.
Define parameter types in separate modules, named such that they take alphabetical precedence over modules containing step definitions that reference these parameter types.
Within step definitions modules, define parameter types before any step definitions which reference them.
📚 Any additional context?
No response
The text was updated successfully, but these errors were encountered:
kieran-ryan
changed the title
Decouple parameter type discovery from step definitions Modules
Decouple parameter type discovery from step definitions modules
Mar 17, 2024
🤔 What's the problem you're trying to solve?
Discovery of parameter types and step definitions is currently defined through Behave alphabetically crawling Python modules in the
steps
directory of an environment, and evaluating each as they are encountered.As step definitions can be discovered before their referenced parameter types, an
UndefinedParameterTypeError
can occur - and is more likely when defined in separate modules (alphabetically dependent) compared to in the same modules (hierarchical reference dependent).However, this may be valid behaviour and there may be performance tradeoffs to consider compared to functionality which is supported as per alternatives defined below.
✨ What's your proposed solution?
The following are potential solutions to this problem:
⛏ Have you considered any alternatives or workarounds?
The following are existing mitigations:
📚 Any additional context?
No response
The text was updated successfully, but these errors were encountered: