Skip to content

Commit

Permalink
Remove not just the charm observers but any observers based in the ch…
Browse files Browse the repository at this point in the history
…arm.
  • Loading branch information
tonyandrewmeyer committed Mar 25, 2024
1 parent c860bfe commit 0a4c99e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ops/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def _forget_charm(self):
# self.charm.on._undefine_event(event_source) # type: ignore
to_remove = []
for handle_path, name, emitter_path, kind in self.framework._observers:
if handle_path == self.charm.handle.path:
if handle_path.startswith(self.charm.handle.path):
to_remove.append((handle_path, name, emitter_path, kind))
for obs in to_remove:
self.framework._observers.remove(obs)
Expand Down

0 comments on commit 0a4c99e

Please sign in to comment.