From 6033c6957ba1b23ac25119e0c2223f83e6459ce9 Mon Sep 17 00:00:00 2001 From: Ali jawwad <33836051+jawwad-ali@users.noreply.github.com> Date: Wed, 29 Jul 2026 20:38:02 +0500 Subject: [PATCH] test(workflows): name the condition-rejection tests for the real boundary (#3808) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `test_validate_rejects_non_string_condition` contradicts its sibling `test_validate_accepts_string_or_bool_condition` in the same class: a bool *is* a non-string, so the two names disagree about the contract the validator actually implements. Rename to `test_validate_rejects_non_string_non_bool_condition` in all three step classes, matching the validator's own message: "'condition' must be a string or boolean, got ". Test names only — no behaviour change, and the parametrized values are untouched. Co-authored-by: Claude Opus 5 (1M context) --- tests/test_workflows.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_workflows.py b/tests/test_workflows.py index 6e191fe79..653ad6d3f 100644 --- a/tests/test_workflows.py +++ b/tests/test_workflows.py @@ -2526,7 +2526,7 @@ class TestIfThenStep: assert any("missing 'condition'" in e for e in errors) @pytest.mark.parametrize("bad", [["a", "b"], {"k": "v"}, 5, 1.5]) - def test_validate_rejects_non_string_condition(self, bad): + def test_validate_rejects_non_string_non_bool_condition(self, bad): # A list/dict/number condition is returned unchanged by # evaluate_expression, and evaluate_condition then bool()-coerces it, so # it silently resolves to its truthiness (e.g. [1, 2] is always True) @@ -2943,7 +2943,7 @@ class TestWhileStep: # max_iterations is optional (defaults to 10) @pytest.mark.parametrize("bad", [["a", "b"], {"k": "v"}, 5, 1.5]) - def test_validate_rejects_non_string_condition(self, bad): + def test_validate_rejects_non_string_non_bool_condition(self, bad): from specify_cli.workflows.steps.while_loop import WhileStep step = WhileStep() @@ -3075,7 +3075,7 @@ class TestDoWhileStep: # max_iterations is optional (defaults to 10) @pytest.mark.parametrize("bad", [["a", "b"], {"k": "v"}, 5, 1.5]) - def test_validate_rejects_non_string_condition(self, bad): + def test_validate_rejects_non_string_non_bool_condition(self, bad): from specify_cli.workflows.steps.do_while import DoWhileStep step = DoWhileStep()