diff --git a/features/steps/ca_continuous_pr_reviewer_steps.py b/features/steps/ca_continuous_pr_reviewer_steps.py index d0cf74b98..fe861ef6e 100644 --- a/features/steps/ca_continuous_pr_reviewer_steps.py +++ b/features/steps/ca_continuous_pr_reviewer_steps.py @@ -56,15 +56,11 @@ def _sort_prs_by_priority( if now_ts is None: now_ts = time.time() due_timestamps: list[float] = [ - pr["milestone_due_ts"] - for pr in prs - if pr.get("milestone_due_ts") is not None + pr["milestone_due_ts"] for pr in prs if pr.get("milestone_due_ts") is not None ] min_due = min(due_timestamps) if due_timestamps else 0.0 max_due = max(due_timestamps) if due_timestamps else 0.0 - scored = [ - (pr, _compute_priority_score(pr, min_due, max_due, now_ts)) for pr in prs - ] + scored = [(pr, _compute_priority_score(pr, min_due, max_due, now_ts)) for pr in prs] scored.sort(key=lambda x: x[1], reverse=True) return [pr for pr, _ in scored] @@ -246,14 +242,10 @@ def step_then_must_have_before_should_have(context: Context) -> None: sorted_prs = context.sorted_prs assert sorted_prs, "Expected a non-empty sorted PR list" must_have_indices = [ - i - for i, pr in enumerate(sorted_prs) - if pr.get("moscow_label") == "Must Have" + i for i, pr in enumerate(sorted_prs) if pr.get("moscow_label") == "Must Have" ] should_have_indices = [ - i - for i, pr in enumerate(sorted_prs) - if pr.get("moscow_label") == "Should Have" + i for i, pr in enumerate(sorted_prs) if pr.get("moscow_label") == "Should Have" ] if must_have_indices and should_have_indices: assert max(must_have_indices) < min(should_have_indices), ( @@ -269,14 +261,10 @@ def step_then_should_have_before_could_have(context: Context) -> None: sorted_prs = context.sorted_prs assert sorted_prs, "Expected a non-empty sorted PR list" should_have_indices = [ - i - for i, pr in enumerate(sorted_prs) - if pr.get("moscow_label") == "Should Have" + i for i, pr in enumerate(sorted_prs) if pr.get("moscow_label") == "Should Have" ] could_have_indices = [ - i - for i, pr in enumerate(sorted_prs) - if pr.get("moscow_label") == "Could Have" + i for i, pr in enumerate(sorted_prs) if pr.get("moscow_label") == "Could Have" ] if should_have_indices and could_have_indices: assert max(should_have_indices) < min(could_have_indices), (