diff --git a/test/test_state.py b/test/test_state.py index 22931a1..302a58c 100644 --- a/test/test_state.py +++ b/test/test_state.py @@ -98,7 +98,7 @@ def _diff_opt(opt1, opt2): if v[1] is not None: for key, values in v[1].items(): for i, value in enumerate(values): - if isinstance(value, tuple): + if isinstance(value, tuple) and value[0] is not None: assert v[1][key][i][0].impl_getname() == val2[idx][1][key][i][0].impl_getname() assert v[1][key][i][1] == val2[idx][1][key][i][1] else: @@ -213,7 +213,8 @@ def test_diff_opt_callback(): b = BoolOption('b', '', callback=return_value) b2 = BoolOption('b2', '', callback=return_value, callback_params={'': ('yes',)}) b3 = BoolOption('b3', '', callback=return_value, callback_params={'': ('yes', (b, False)), 'value': ('no',)}) - o = OptionDescription('o', '', [b, b2, b3]) + b4 = BoolOption("b4", "", callback=return_value, callback_params={'': ((None,),), 'value': ('string',)}) + o = OptionDescription('o', '', [b, b2, b3, b4]) o1 = OptionDescription('o1', '', [o]) o1.impl_build_cache_consistency() o1.impl_build_cache_option() diff --git a/tiramisu/option/baseoption.py b/tiramisu/option/baseoption.py index 7895661..410980c 100644 --- a/tiramisu/option/baseoption.py +++ b/tiramisu/option/baseoption.py @@ -231,7 +231,7 @@ class BaseOption(Base): for key, values in callback_params.items(): vls = [] for value in values: - if isinstance(value, tuple): + if isinstance(value, tuple) and value[0] is not None: if load: value = (descr.impl_get_opt_by_path(value[0]), value[1])