ruff: Fix PLR6104 Use += to perform an augmented assignment directly.

This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-07-14 12:06:04 -07:00
committed by Tim Abbott
parent b96feb34f6
commit 1e9b6445a9
24 changed files with 39 additions and 43 deletions

View File

@@ -158,7 +158,7 @@ def process_count_stat(stat: CountStat, fill_to_time: datetime, realm: Realm | N
return
fill_to_time = min(fill_to_time, dependency_fill_time)
currently_filled = currently_filled + stat.time_increment
currently_filled += stat.time_increment
while currently_filled <= fill_to_time:
logger.info("START %s %s", stat.property, currently_filled)
start = time.time()
@@ -166,7 +166,7 @@ def process_count_stat(stat: CountStat, fill_to_time: datetime, realm: Realm | N
do_fill_count_stat_at_hour(stat, currently_filled, realm)
do_update_fill_state(fill_state, currently_filled, FillState.DONE)
end = time.time()
currently_filled = currently_filled + stat.time_increment
currently_filled += stat.time_increment
logger.info("DONE %s (%dms)", stat.property, (end - start) * 1000)

View File

@@ -337,7 +337,7 @@ class TestProcessCountStat(AnalyticsTestCase):
self.assertEqual(InstallationCount.objects.filter(property=stat.property).count(), 1)
# clean stat, with update
current_time = current_time + self.HOUR
current_time += self.HOUR
stat = self.make_dummy_count_stat("test stat")
process_count_stat(stat, current_time)
self.assertFillStateEquals(stat, current_time)