@@ -917,32 +917,23 @@ def test_dynamic_rx(self):
917917 assert_element_equal (dmap [()], hv .Curve (sine_array (0 , 2 )))
918918
919919
920- class TestStreamSubscribersAddandClear :
921- def setup_method (self ):
922- self .fn1 = lambda x : x
923- self .fn2 = lambda x : x ** 2
924- self .fn3 = lambda x : x ** 3
925- self .fn4 = lambda x : x ** 4
926-
927- # Precedence one and below is the user range, above one is reserved for
928- # HoloViews, as documented on Stream.add_subscriber
929- @pytest .mark .parametrize (
930- ("policy" , "remaining" ),
931- [
932- ("all" , []),
933- ("user" , ["fn3" , "fn4" ]),
934- ("internal" , ["fn1" , "fn2" ]),
935- ],
936- )
937- def test_subscriber_clear (self , policy , remaining ):
938- pointerx = PointerX (x = 2 )
939- pointerx .add_subscriber (self .fn1 , precedence = 0 )
940- pointerx .add_subscriber (self .fn2 , precedence = 1 )
941- pointerx .add_subscriber (self .fn3 , precedence = 1.5 )
942- pointerx .add_subscriber (self .fn4 , precedence = 10 )
943- assert pointerx .subscribers == [self .fn1 , self .fn2 , self .fn3 , self .fn4 ]
944- pointerx .clear (policy )
945- assert pointerx .subscribers == [getattr (self , name ) for name in remaining ]
920+ @pytest .mark .parametrize (
921+ ("policy" , "remaining" ),
922+ [("all" , []), ("user" , ["fn3" , "fn4" ]), ("internal" , ["fn1" , "fn2" ])],
923+ )
924+ def test_subscriber_clear (self , policy , remaining ):
925+ self .fn1 = lambda x : x
926+ self .fn2 = lambda x : x ** 2
927+ self .fn3 = lambda x : x ** 3
928+ self .fn4 = lambda x : x ** 4
929+ pointerx = PointerX (x = 2 )
930+ pointerx .add_subscriber (self .fn1 , precedence = 0 )
931+ pointerx .add_subscriber (self .fn2 , precedence = 1 )
932+ pointerx .add_subscriber (self .fn3 , precedence = 1.5 )
933+ pointerx .add_subscriber (self .fn4 , precedence = 10 )
934+ assert pointerx .subscribers == [self .fn1 , self .fn2 , self .fn3 , self .fn4 ]
935+ pointerx .clear (policy )
936+ assert pointerx .subscribers == [getattr (self , name ) for name in remaining ]
946937
947938
948939class TestDynamicStreamReset :
0 commit comments