From fa7dd650bbf8e644efa60101cd6be1c0481b843d Mon Sep 17 00:00:00 2001 From: Ben Hoyt Date: Tue, 17 Oct 2023 16:03:49 +1300 Subject: [PATCH] Code review tweaks 2 --- ops/charm.py | 2 +- ops/testing.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ops/charm.py b/ops/charm.py index bf00b30ef..b3a0711ee 100755 --- a/ops/charm.py +++ b/ops/charm.py @@ -860,7 +860,7 @@ class CollectStatusEvent(EventBase): The framework will trigger these events after the hook code runs successfully (``collect_app_status`` will only be triggered on the leader - unit). If any statuses were added by the event handlers using + unit). If any statuses were added by the event handler using :meth:`add_status`, the framework will choose the highest-priority status and set that as the status (application status for ``collect_app_status``, or unit status for ``collect_unit_status``). diff --git a/ops/testing.py b/ops/testing.py index d2c043977..a8f830f34 100755 --- a/ops/testing.py +++ b/ops/testing.py @@ -1632,8 +1632,10 @@ def evaluate_status(self) -> None: statuses were added. Tests should normally call this and then assert that ``self.model.app.status`` - or ``self.model.unit.status`` is the value expected. This method resets the - added statuses before triggering the collect-status events. + or ``self.model.unit.status`` is the value expected. + + Evaluation is not "additive"; this method resets the added statuses before + triggering each collect-status event. """ self.charm.app._collected_statuses = [] self.charm.unit._collected_statuses = []