-
I would like to be able to run from behave import some_behave_submodule
if not some_behave_submodule.dry_run:
import wet_only_dependency |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Such a functionality is currently not supported (on module level) while loading the environment-file and the step-modules. If you need such a functionality, you can easily support your use case by using a special environment variable, like: # -- EXAMPLE bash-like shell is used
$ BEHAVE_SLIM_MODE=ON behave --dry -f steps.usage
... # -- FILE: features/environment.py
import os
BEHAVE_SLIM_MODE_ENABLED = os.environ.get("BEHAVE_SLIM_MODE", "OFF") == "ON"
if not BEHAVE_SLIM_MODE_ENABLED:
# -- NORMAL CASE: Import all needed modules and parts.
...
else:
... # Whatever |
Beta Was this translation helpful? Give feedback.
Such a functionality is currently not supported (on module level) while loading the environment-file and the step-modules.
In addition, I do not think that this is not such a good idea. It is a HACK in my opinion (using the dry-run mode and having a partially usable workspace are two different things).
If you need such a functionality, you can easily support your use case by using a special environment variable, like:
# -- EXAMPLE bash-like shell is used $ BEHAVE_SLIM_MODE=ON behave --dry -f steps.usage ...