@@ -496,7 +496,8 @@ def lambda_handler(evt, context):
496
496
# THEN ColdStart metric and function_name and service dimension should be logged
497
497
assert output ["ColdStart" ] == [1.0 ]
498
498
assert output ["function_name" ] == "example_fn"
499
- assert output ['service' ] == service
499
+ assert output ["service" ] == service
500
+
500
501
501
502
def test_log_metrics_capture_cold_start_metric_no_service (capsys , namespace ):
502
503
# GIVEN Metrics is initialized without service
@@ -515,7 +516,7 @@ def lambda_handler(evt, context):
515
516
# THEN ColdStart metric and function_name dimension should be logged
516
517
assert output ["ColdStart" ] == [1.0 ]
517
518
assert output ["function_name" ] == "example_fn"
518
- assert output .get (' service' ) is None
519
+ assert output .get (" service" ) is None
519
520
520
521
521
522
def test_emit_cold_start_metric_only_once (capsys , namespace , service , metric ):
@@ -551,6 +552,7 @@ def lambda_handler(evt, context):
551
552
552
553
# THEN it should raise a warning instead of throwing an exception
553
554
with warnings .catch_warnings (record = True ) as w :
555
+ warnings .simplefilter ("default" )
554
556
lambda_handler ({}, {})
555
557
assert len (w ) == 1
556
558
assert str (w [- 1 ].message ) == "No metrics to publish, skipping"
0 commit comments