Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

ruff: Fix RUF007 Prefer `itertools.pairwise()` over `zip()`.

Anders Kaseorgccb95e76dcc4
diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py
index 16ecc665e80..b681455e449 100644
--- a/corporate/tests/test_stripe.py
+++ b/corporate/tests/test_stripe.py
@@ -1,3 +1,4 @@
+import itertools
import json
import operator
import os
@@ -4599,11 +4600,11 @@ class BillingHelpersTest(ZulipTestCase):
for i, boundary in enumerate(period_boundaries):
self.assertEqual(add_months(anchor, i), boundary)
# Test next_month for small values
- for last, next_ in zip(period_boundaries[:-1], period_boundaries[1:]):
+ for last, next_ in itertools.pairwise(period_boundaries):
self.assertEqual(next_month(anchor, last), next_)
# Test next_month for large values
period_boundaries = [dt.replace(year=dt.year + 100) for dt in period_boundaries]
- for last, next_ in zip(period_boundaries[:-1], period_boundaries[1:]):
+ for last, next_ in itertools.pairwise(period_boundaries):
self.assertEqual(next_month(anchor, last), next_)
def test_compute_plan_parameters(self) -> None: