From 1a545ae445a55b9a9302cdc250f3acb34a7a2884 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 26 Mar 2024 08:44:54 +0100 Subject: [PATCH] move registering the exception then it might be clearer what's going on here --- lib/galaxy/tool_util/verify/interactor.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/tool_util/verify/interactor.py b/lib/galaxy/tool_util/verify/interactor.py index 28b590f53bd1..9043cf5c885d 100644 --- a/lib/galaxy/tool_util/verify/interactor.py +++ b/lib/galaxy/tool_util/verify/interactor.py @@ -1539,6 +1539,7 @@ def register_exception(e: Exception): outfile = output_dict["value"] attributes = output_dict["attributes"] output_testdef = Bunch(name=name, outfile=outfile, attributes=attributes) + output_data = None try: output_data = data_list[name] except (TypeError, KeyError): @@ -1551,7 +1552,8 @@ def register_exception(e: Exception): else: output_data = data_list[len(data_list) - len(testdef.outputs) + output_index] except IndexError: - pass + error = AssertionError(f"Tool did not produce an output with name '{name}' (or at index {output_index})") + register_exception(error) if output_data: try: galaxy_interactor.verify_output( @@ -1565,9 +1567,6 @@ def register_exception(e: Exception): ) except Exception as e: register_exception(e) - else: - error = AssertionError(f"Tool did not produce an output with name '{name}' (or at index {output_index})") - register_exception(error) other_checks = { "command_line": "Command produced by the job",