Skip to content

How to skip import in dry mode? #1093

Closed Answered by jenisys
djasa asked this question in Q&A
Discussion options

You must be logged in to vote

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
...
# -- 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 …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jenisys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants