From 9d6266968f2436cede2ab8b67d9146de52b94f68 Mon Sep 17 00:00:00 2001 From: Josue Nina Date: Tue, 3 Mar 2026 18:10:40 -0500 Subject: [PATCH] Use isdigit() to reliably select backtest result --- tests/test_cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index f8f1b024..485352a3 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -264,13 +264,13 @@ def test_cli() -> None: # Generate reports python_results_file = next(f for f in python_backtest_dirs[0].iterdir() if - f.name.endswith(".json") and not f.name.endswith("-order-events.json")) + f.suffix == ".json" and f.stem.isdigit()) run_command(["lean", "report", "--backtest-results", str(python_results_file), "--report-destination", "python.html"], cwd=test_dir) csharp_results_file = next(f for f in csharp_backtest_dirs[0].iterdir() if - f.name.endswith(".json") and not f.name.endswith("-order-events.json")) + f.suffix == ".json" and f.stem.isdigit()) run_command(["lean", "report", "--backtest-results", str(csharp_results_file), "--report-destination", "csharp.html"], cwd=test_dir)