@@ -448,6 +448,7 @@ def test_schema_validation_no_namespace(metric, dimension):
448448
449449def test_schema_validation_empty_metric_name (metric , dimension , namespace ):
450450 # GIVEN we pass an empty metric name
451+ my_metrics = AmazonCloudWatchEMFProvider (namespace = namespace )
451452 metric ["name" ] = ""
452453
453454 # WHEN we attempt to add a metric
@@ -456,12 +457,12 @@ def test_schema_validation_empty_metric_name(metric, dimension, namespace):
456457 MetricNameError ,
457458 match = f"The metric name should be between { MIN_METRIC_NAME_LENGTH } and { MAX_METRIC_NAME_LENGTH } characters" ,
458459 ):
459- with single_metric (** metric ):
460- pass
460+ my_metrics .add_metric (** metric )
461461
462462
463463def test_schema_validation_long_metric_name (metric , dimension , namespace ):
464464 # GIVEN we pass a metric name outside the maximum length constraint
465+ my_metrics = AmazonCloudWatchEMFProvider (namespace = namespace )
465466 metric [
466467 "name"
467468 ] = """Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.
@@ -474,8 +475,7 @@ def test_schema_validation_long_metric_name(metric, dimension, namespace):
474475 MetricNameError ,
475476 match = f"The metric name should be between { MIN_METRIC_NAME_LENGTH } and { MAX_METRIC_NAME_LENGTH } characters" ,
476477 ):
477- with single_metric (** metric ):
478- pass
478+ my_metrics .add_metric (** metric )
479479
480480
481481def test_schema_validation_incorrect_metric_value (metric , dimension , namespace ):
0 commit comments