Skip to content

Commit

Permalink
fix(QAWTO-212): move behave import to selected function
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogarfe committed Jun 28, 2024
1 parent fe89819 commit b17c3dc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions toolium/behave/env_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
import sys
import warnings

# Behave is an optional dependency in toolium, so it is imported here
from behave.model_core import Status

# Actions types defined in feature files
ACTIONS_BEFORE_FEATURE = 'actions before the feature'
ACTIONS_BEFORE_SCENARIO = 'actions before each scenario'
Expand Down Expand Up @@ -313,6 +310,8 @@ def fail_first_step_precondition_exception(self, scenario, error_message):
:param scenario: Behave's Scenario
:param error_message: Exception message
"""
# Behave is an optional dependency in toolium, so it is imported here
from behave.model_core import Status
if len(scenario.steps) > 0:
scenario.steps[0].status = Status.failed
scenario.steps[0].exception = Exception('Preconditions failed')
Expand Down

0 comments on commit b17c3dc

Please sign in to comment.