File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
sdks/python/apache_beam/runners/worker Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 2121import logging
2222import time
2323import unittest
24- from unittest .mock import Mock
24+ from unittest .mock import Mock , patch
2525
2626from tenacity import retry
2727from tenacity import stop_after_attempt
@@ -185,7 +185,8 @@ def test_process_timers_metric_is_recorded(self):
185185 expected_value * (1.0 + margin_of_error ),
186186 "The timer metric was higher than expected." )
187187
188- def test_do_operation_process_timer_metric (self ):
188+ @patch ('apache_beam.runners.common.DoFnRunner' )
189+ def test_do_operation_process_timer_metric (self , mock_dofn_runner ):
189190 """
190191 Tests that the 'process-timers-msecs' metric is correctly recorded
191192 when a timer is processed within a DoOperation.
@@ -256,7 +257,8 @@ def mock_process_user_timer(*args, **kwargs):
256257 expected_value * (1.0 + margin_of_error ),
257258 "The timer metric was higher than expected." )
258259
259- def test_do_operation_process_timer_metric_with_exception (self ):
260+ @patch ('apache_beam.runners.common.DoFnRunner' )
261+ def test_do_operation_process_timer_metric_with_exception (self , mock_dofn_runner ):
260262 """
261263 Tests that the 'process-timers-msecs' metric is still recorded
262264 when a timer callback in a DoOperation raises an exception.
You can’t perform that action at this time.
0 commit comments