From 28b937b1b7f30173af8ab7eefd8a6cbb56b3d121 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 14 Sep 2022 17:16:58 +0200 Subject: [PATCH] post merge cleanup --- lib/galaxy/tool_util/linters/tests.py | 4 ++-- test/unit/tool_util/test_tool_linters.py | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/tool_util/linters/tests.py b/lib/galaxy/tool_util/linters/tests.py index db15aac2281..4f30343d78a 100644 --- a/lib/galaxy/tool_util/linters/tests.py +++ b/lib/galaxy/tool_util/linters/tests.py @@ -38,7 +38,7 @@ def lint_tsts(tool_xml, lint_ctx): if len(assertions) == 0: continue if len(assertions) > 1: - lint_ctx.error(f"Test {test_idx}: More than one {ta} found. Only the first is considered.") + lint_ctx.error(f"Test {test_idx}: More than one {ta} found. Only the first is considered.", node=test) has_test = True _check_asserts(test_idx, assertions, lint_ctx) _check_asserts(test_idx, test.findall(".//assert_contents"), lint_ctx) @@ -46,7 +46,7 @@ def lint_tsts(tool_xml, lint_ctx): # check if expect_num_outputs is set if there are outputs with filters filter = tool_xml.findall("./outputs//filter") if len(filter) > 0 and "expect_num_outputs" not in test.attrib: - lint_ctx.warn("Test should specify 'expect_num_outputs' if outputs have filters") + lint_ctx.warn("Test should specify 'expect_num_outputs' if outputs have filters", node=test) # really simple test that test parameters are also present in the inputs for param in test.findall("param"): diff --git a/test/unit/tool_util/test_tool_linters.py b/test/unit/tool_util/test_tool_linters.py index f43aafdbc0b..8e1ff98d50d 100644 --- a/test/unit/tool_util/test_tool_linters.py +++ b/test/unit/tool_util/test_tool_linters.py @@ -758,6 +758,7 @@ TESTS_EXPECT_NUM_OUTPUTS_FILTER = """ +""" # tool xml for xml_order linter XML_ORDER = """ @@ -1575,10 +1576,7 @@ def test_tests_discover_outputs(lint_ctx): def test_tests_expect_num_outputs_filter(lint_ctx): tool_source = get_xml_tool_source(TESTS_EXPECT_NUM_OUTPUTS_FILTER) run_lint(lint_ctx, tests.lint_tsts, tool_source) - assert ( - "Test should specify 'expect_num_outputs' if outputs have filters" in - in lint_ctx.warn_messages - ) + assert "Test should specify 'expect_num_outputs' if outputs have filters" in lint_ctx.warn_messages assert len(lint_ctx.warn_messages) == 1 assert len(lint_ctx.error_messages) == 0