From 22b733d0aac77d24de7974c332a8896e01012d69 Mon Sep 17 00:00:00 2001 From: 69049ed6x <69049ed6x@users.noreply.github.com> Date: Sat, 7 Mar 2026 15:24:43 +0800 Subject: [PATCH] test: cover factor rule condition stringification --- tests/test_factor_rules.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_factor_rules.py b/tests/test_factor_rules.py index 92684354..a2a11ff0 100644 --- a/tests/test_factor_rules.py +++ b/tests/test_factor_rules.py @@ -195,6 +195,15 @@ class FactorRulesPathTests(unittest.TestCase): self.assertIn("- Conditions: No explicit conditions provided", summary) self.assertIn("- Rationale: No screen provided", summary) + def test_summarize_factor_rules_stringifies_non_string_conditions(self): + summary = summarize_factor_rules( + [{"name": "Macro", "signal": "neutral", "conditions": [1, True, 3.14]}], + ticker="QQQ", + trade_date="2026-03-07", + ) + + self.assertIn("- Conditions: 1; True; 3.14", summary) + if __name__ == "__main__": unittest.main()