Skip to content

Commit 46fdeda

Browse files
authored
Use isdigit() to reliably select backtest result (#632)
1 parent 4272e06 commit 46fdeda

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,13 @@ def test_cli() -> None:
264264

265265
# Generate reports
266266
python_results_file = next(f for f in python_backtest_dirs[0].iterdir() if
267-
f.name.endswith(".json") and not f.name.endswith("-order-events.json"))
267+
f.suffix == ".json" and f.stem.isdigit())
268268
run_command(["lean", "report",
269269
"--backtest-results", str(python_results_file),
270270
"--report-destination", "python.html"], cwd=test_dir)
271271

272272
csharp_results_file = next(f for f in csharp_backtest_dirs[0].iterdir() if
273-
f.name.endswith(".json") and not f.name.endswith("-order-events.json"))
273+
f.suffix == ".json" and f.stem.isdigit())
274274
run_command(["lean", "report",
275275
"--backtest-results", str(csharp_results_file),
276276
"--report-destination", "csharp.html"], cwd=test_dir)

0 commit comments

Comments
 (0)