@@ -48,28 +48,28 @@ class TelemetryHandlerWorkflowTest(_WorkflowTestBase):
4848 # ------------------------------------------------------------------
4949
5050 def test_start_workflow_creates_span (self ) -> None :
51- invocation = self .handler .start_workflow ("my_workflow" )
51+ invocation = self .handler .start_workflow (name = "my_workflow" )
5252 self .assertIsNot (invocation .span , INVALID_SPAN )
5353 invocation .stop ()
5454
5555 def test_start_workflow_span_name (self ) -> None :
56- invocation = self .handler .start_workflow ("my_pipeline" )
56+ invocation = self .handler .start_workflow (name = "my_pipeline" )
5757 invocation .stop ()
5858
5959 spans = self ._get_finished_spans ()
6060 self .assertEqual (len (spans ), 1 )
6161 self .assertEqual (spans [0 ].name , "invoke_workflow my_pipeline" )
6262
6363 def test_start_workflow_span_name_without_name (self ) -> None :
64- invocation = self .handler .start_workflow (None )
64+ invocation = self .handler .start_workflow (name = None )
6565 invocation .stop ()
6666
6767 spans = self ._get_finished_spans ()
6868 self .assertEqual (len (spans ), 1 )
6969 self .assertEqual (spans [0 ].name , "invoke_workflow" )
7070
7171 def test_start_workflow_span_kind_is_internal (self ) -> None :
72- invocation = self .handler .start_workflow ("wf" )
72+ invocation = self .handler .start_workflow (name = "wf" )
7373 invocation .stop ()
7474
7575 spans = self ._get_finished_spans ()
@@ -78,7 +78,7 @@ def test_start_workflow_span_kind_is_internal(self) -> None:
7878
7979 def test_start_workflow_records_monotonic_start (self ) -> None :
8080 with patch ("timeit.default_timer" , return_value = 500.0 ):
81- invocation = self .handler .start_workflow ("wf" )
81+ invocation = self .handler .start_workflow (name = "wf" )
8282 self .assertEqual (invocation ._monotonic_start_s , 500.0 )
8383 invocation .stop ()
8484
@@ -87,14 +87,14 @@ def test_start_workflow_records_monotonic_start(self) -> None:
8787 # ------------------------------------------------------------------
8888
8989 def test_stop_workflow_ends_span (self ) -> None :
90- invocation = self .handler .start_workflow ("wf" )
90+ invocation = self .handler .start_workflow (name = "wf" )
9191 invocation .stop ()
9292
9393 spans = self ._get_finished_spans ()
9494 self .assertEqual (len (spans ), 1 )
9595
9696 def test_stop_workflow_sets_operation_name_attribute (self ) -> None :
97- invocation = self .handler .start_workflow ("wf" )
97+ invocation = self .handler .start_workflow (name = "wf" )
9898 invocation .stop ()
9999
100100 spans = self ._get_finished_spans ()
@@ -104,15 +104,15 @@ def test_stop_workflow_sets_operation_name_attribute(self) -> None:
104104 )
105105
106106 def test_stop_workflow_sets_custom_attributes (self ) -> None :
107- invocation = self .handler .start_workflow ("wf" )
107+ invocation = self .handler .start_workflow (name = "wf" )
108108 invocation .attributes ["custom.key" ] = "custom_value"
109109 invocation .stop ()
110110
111111 spans = self ._get_finished_spans ()
112112 self .assertEqual (spans [0 ].attributes ["custom.key" ], "custom_value" )
113113
114114 def test_stop_workflow_returns_invocation (self ) -> None :
115- invocation = self .handler .start_workflow ("wf" )
115+ invocation = self .handler .start_workflow (name = "wf" )
116116 invocation .stop ()
117117 spans = self ._get_finished_spans ()
118118 self .assertEqual (len (spans ), 1 )
@@ -122,7 +122,7 @@ def test_stop_workflow_returns_invocation(self) -> None:
122122 # ------------------------------------------------------------------
123123
124124 def test_fail_workflow_sets_error_status (self ) -> None :
125- invocation = self .handler .start_workflow ("wf" )
125+ invocation = self .handler .start_workflow (name = "wf" )
126126 error = Error (message = "something broke" , type = RuntimeError )
127127 invocation .fail (error )
128128
@@ -132,15 +132,15 @@ def test_fail_workflow_sets_error_status(self) -> None:
132132 self .assertEqual (spans [0 ].status .description , "something broke" )
133133
134134 def test_fail_workflow_sets_error_type_attribute (self ) -> None :
135- invocation = self .handler .start_workflow ("wf" )
135+ invocation = self .handler .start_workflow (name = "wf" )
136136 error = Error (message = "bad" , type = ValueError )
137137 invocation .fail (error )
138138
139139 spans = self ._get_finished_spans ()
140140 self .assertEqual (spans [0 ].attributes ["error.type" ], "ValueError" )
141141
142142 def test_fail_workflow_sets_operation_name_attribute (self ) -> None :
143- invocation = self .handler .start_workflow ("wf" )
143+ invocation = self .handler .start_workflow (name = "wf" )
144144 error = Error (message = "fail" , type = TypeError )
145145 invocation .fail (error )
146146
@@ -151,7 +151,7 @@ def test_fail_workflow_sets_operation_name_attribute(self) -> None:
151151 )
152152
153153 def test_fail_workflow_ends_span (self ) -> None :
154- invocation = self .handler .start_workflow ("wf" )
154+ invocation = self .handler .start_workflow (name = "wf" )
155155 invocation .fail (Error (message = "err" , type = RuntimeError ))
156156 spans = self ._get_finished_spans ()
157157 self .assertEqual (len (spans ), 1 )
0 commit comments