diff --git a/src/_balder/executor/executor_tree.py b/src/_balder/executor/executor_tree.py index 1f0b952..0605da4 100644 --- a/src/_balder/executor/executor_tree.py +++ b/src/_balder/executor/executor_tree.py @@ -56,7 +56,8 @@ def parent_executor(self) -> None: # ---------------------------------- PROTECTED METHODS ------------------------------------------------------------- def _prepare_execution(self, show_discarded): - pass + if not show_discarded: + self.update_inner_feature_reference_in_all_setups() def _body_execution(self, show_discarded): for cur_setup_executor in self.get_setup_executors(): @@ -140,6 +141,16 @@ def cleanup_empty_executor_branches(self, consider_discarded=False): for cur_setup_executor in to_remove_executor: self._setup_executors.remove(cur_setup_executor) + def update_inner_feature_reference_in_all_setups(self): + """ + This method iterates over all setups and triggers the method that updates the inner feature references. + + This needs to be done on ExecutorTree level, because this reference should also be accessible within session + fixtures (in case they have setup scope). + """ + for cur_setup_executor in self.get_setup_executors(): + cur_setup_executor.update_inner_referenced_feature_instances() + def execute(self, show_discarded=False) -> None: """ This method executes this branch of the tree diff --git a/src/_balder/executor/setup_executor.py b/src/_balder/executor/setup_executor.py index 4815eb8..c45c8ff 100644 --- a/src/_balder/executor/setup_executor.py +++ b/src/_balder/executor/setup_executor.py @@ -74,8 +74,6 @@ def fixture_manager(self) -> FixtureManager: def _prepare_execution(self, show_discarded): print(f"SETUP {self.base_setup_class.__class__.__name__}") - if not show_discarded: - self.update_inner_referenced_feature_instances() def _body_execution(self, show_discarded): for cur_scenario_executor in self.get_scenario_executors():