Skip to content

Commit

Permalink
fix: context.storage must be initialized before dynamic environment s… (
Browse files Browse the repository at this point in the history
#344)

* fix: context.storage must be initialized before dynamic environment steps

* add py311 fix in changelog
  • Loading branch information
rgonalo committed May 8, 2023
1 parent 57664a9 commit 37f2d1d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -9,6 +9,8 @@ v3.0.1
- Allow to search in `context.storage` using `[CONTEXT:a.b.c]` replacement when `before_feature` method is not used
- Execute after scenario methods also when a scenario is skipped to assure that scenario preconditions are cleaned
- Fix `[LANG:key]` replacement bug when it contains carriage returns
- `context.storage` must be initialized before dynamic environment steps
- Fix error in Python 3.11 executing nose2 tests

v3.0.0
------
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
3.0.1.dev0
3.0.1.dev2
5 changes: 3 additions & 2 deletions toolium/behave/environment.py
Expand Up @@ -128,10 +128,11 @@ def before_scenario(context, scenario):

context.logger.info("Running new scenario: %s", scenario.name)

# Make sure storage dict are empty in each scenario
context.storage = dict()

# Behave dynamic environment
context.dyn_env.execute_before_scenario_steps(context)
# Make sure storage dict are empty
context.storage = dict()


def create_and_configure_wrapper(context):
Expand Down
2 changes: 1 addition & 1 deletion toolium/config_driver.py
Expand Up @@ -386,7 +386,7 @@ def _add_chrome_additional_options(self, options):
:param options: Chrome options object
"""
chrome_options = self.config.get_optional('Chrome', 'options')
if options:
if chrome_options:
try:
for key, value in ast.literal_eval(chrome_options).items():
self.logger.debug("Added Chrome additional option: %s = %s", key, value)
Expand Down

0 comments on commit 37f2d1d

Please sign in to comment.