-
Notifications
You must be signed in to change notification settings - Fork 0
Description
π€ 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:
- 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