@@ -44,25 +44,16 @@ def test_lambda_metric_flush_to_log_with_extension(self):
4444
4545 @patch ("datadog_lambda.metric.should_use_extension" , True )
4646 def test_lambda_metric_timestamp_with_extension (self ):
47- patcher = patch ("datadog_lambda.metric.extension_thread_stats" )
48- self .mock_metric_extension_thread_stats = patcher .start ()
49- self .addCleanup (patcher .stop )
50-
5147 delta = timedelta (minutes = 1 )
5248 timestamp = int ((datetime .now () - delta ).timestamp ())
5349
5450 lambda_metric ("test_timestamp" , 1 , timestamp )
5551 self .mock_metric_lambda_stats .distribution .assert_has_calls (
5652 [call ("test_timestamp" , 1 , timestamp = timestamp , tags = [dd_lambda_layer_tag ])]
5753 )
58- self .mock_metric_extension_thread_stats .distribution .assert_not_called ()
5954
6055 @patch ("datadog_lambda.metric.should_use_extension" , True )
6156 def test_lambda_metric_datetime_with_extension (self ):
62- patcher = patch ("datadog_lambda.metric.extension_thread_stats" )
63- self .mock_metric_extension_thread_stats = patcher .start ()
64- self .addCleanup (patcher .stop )
65-
6657 delta = timedelta (minutes = 1 )
6758 timestamp = datetime .now () - delta
6859
@@ -77,20 +68,14 @@ def test_lambda_metric_datetime_with_extension(self):
7768 )
7869 ]
7970 )
80- self .mock_metric_extension_thread_stats .distribution .assert_not_called ()
8171
8272 @patch ("datadog_lambda.metric.should_use_extension" , True )
8373 def test_lambda_metric_invalid_timestamp_with_extension (self ):
84- patcher = patch ("datadog_lambda.metric.extension_thread_stats" )
85- self .mock_metric_extension_thread_stats = patcher .start ()
86- self .addCleanup (patcher .stop )
87-
8874 delta = timedelta (hours = 5 )
8975 timestamp = int ((datetime .now () - delta ).timestamp ())
9076
9177 lambda_metric ("test_timestamp" , 1 , timestamp )
9278 self .mock_metric_lambda_stats .distribution .assert_not_called ()
93- self .mock_metric_extension_thread_stats .distribution .assert_not_called ()
9479
9580 def test_lambda_metric_flush_to_log (self ):
9681 os .environ ["DD_FLUSH_TO_LOG" ] = "True"
@@ -135,10 +120,6 @@ def setUp(self):
135120 self .mock_threadstats_flush_distributions = patcher .start ()
136121 self .addCleanup (patcher .stop )
137122
138- patcher = patch ("datadog_lambda.metric.extension_thread_stats" )
139- self .mock_extension_thread_stats = patcher .start ()
140- self .addCleanup (patcher .stop )
141-
142123 def test_retry_on_remote_disconnected (self ):
143124 # Raise the RemoteDisconnected error
144125 lambda_stats = ThreadStatsWriter (True )
@@ -217,10 +198,6 @@ def test_flush_temp_constant_tags(self):
217198 lambda_stats .thread_stats .constant_tags , original_constant_tags
218199 )
219200
220- def test_flush_stats_without_context (self ):
221- flush_stats (lambda_context = None )
222- self .mock_extension_thread_stats .flush .assert_called_with (None )
223-
224201
225202MOCK_FUNCTION_NAME = "myFunction"
226203
0 commit comments