File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55from __future__ import annotations
66
7+ import logging
78import weakref
89from collections import defaultdict
910
@@ -160,6 +161,28 @@ def test_explicit_parameter(self):
160161 assert self .ExplicitTest .param ["test" ].default == 42
161162 assert self .ExplicitTest .param ["test" ].doc == "Test docstring"
162163
164+ def test_subscriber_error_logging_isolation (self , caplog ):
165+ xy = self .XY ()
166+ calls = []
167+
168+ def bad_subscriber (** kw ):
169+ calls .append ("bad" )
170+ raise RuntimeError ("simulated upstream bug" )
171+
172+ def good_subscriber (** kw ):
173+ calls .append ("good" )
174+
175+ xy .add_subscriber (bad_subscriber )
176+ xy .add_subscriber (good_subscriber )
177+
178+ with caplog .at_level (logging .ERROR , logger = "holoviews.streams" ):
179+ Stream .trigger ([xy ])
180+
181+ assert "simulated upstream bug" in caplog .text
182+ assert "bad_subscriber" in caplog .text
183+ assert len (calls ) == 2
184+ assert calls == ["bad" , "good" ]
185+
163186
164187class _Subscriber :
165188 def __init__ (self , cb = None ):
You can’t perform that action at this time.
0 commit comments