Skip to content

Commit

Permalink
Merge branch 'feat/improve_storage' of github.com:josemiguel-rodrigue…
Browse files Browse the repository at this point in the history
…znaranjo/toolium into feat/improve_storage
  • Loading branch information
josemiguel-rodrigueznaranjo committed Jun 26, 2024
2 parents 4f93209 + f3b8268 commit 87eefd3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions toolium/utils/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"""

import base64
import collections
import datetime
import json
import logging
Expand Down Expand Up @@ -684,8 +683,11 @@ def _get_initial_value_from_context(initial_key, context):
"""
context_storage = context.storage if hasattr(context, 'storage') else {}
if hasattr(context, 'feature_storage'):
# context.feature_storage is initialized only when before_feature method is called
context_storage = collections.ChainMap(context.storage, context.feature_storage)
# Merge feature to storage, context.feature_storage is initialized only when before_feature method is called
context_storage.update(context.feature_storage)
if hasattr(context, 'run_storage'):
# Merge run to storage, context.run_storage is initialized only when before_all method is called
context_storage.update(context.run_storage)
if initial_key in context_storage:
value = context_storage[initial_key]
elif hasattr(context, initial_key):
Expand Down

0 comments on commit 87eefd3

Please sign in to comment.