From a58873fd68ca75d4e8be565b385f937b865f5947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=CC=81ngel=20Morcillo=20Gime=CC=81nez?= Date: Wed, 26 Jun 2024 13:41:33 +0200 Subject: [PATCH 1/2] add run storage to get initial value from context --- toolium/utils/dataset.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/toolium/utils/dataset.py b/toolium/utils/dataset.py index 2750f81c..2d04aae3 100644 --- a/toolium/utils/dataset.py +++ b/toolium/utils/dataset.py @@ -684,8 +684,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): From 5592cb351a23159af0ed1c59cac9efeb8c2b88fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=CC=81ngel=20Morcillo=20Gime=CC=81nez?= Date: Wed, 26 Jun 2024 13:49:39 +0200 Subject: [PATCH 2/2] remove collections --- toolium/utils/dataset.py | 1 - 1 file changed, 1 deletion(-) diff --git a/toolium/utils/dataset.py b/toolium/utils/dataset.py index 2d04aae3..851572b4 100644 --- a/toolium/utils/dataset.py +++ b/toolium/utils/dataset.py @@ -17,7 +17,6 @@ """ import base64 -import collections import datetime import json import logging