@@ -419,7 +419,7 @@ def test_metrics_enabled_with_env_var_false(monkeypatch, capsys):
419
419
monkeypatch .setenv ("POWERTOOLS_METRICS_DISABLED" , "false" )
420
420
421
421
# WHEN metrics is initialized with namespace and metrics added
422
- metrics = DatadogMetrics (namespace = "test" )
422
+ metrics = DatadogMetrics (namespace = "test" , flush_to_log = True )
423
423
metrics .add_metric (name = "test_metric" , value = 1 )
424
424
metrics .flush_metrics ()
425
425
@@ -435,7 +435,7 @@ def test_metrics_enabled_with_env_var_not_set(monkeypatch, capsys):
435
435
monkeypatch .delenv ("POWERTOOLS_METRICS_DISABLED" , raising = False )
436
436
437
437
# WHEN metrics is initialized with namespace and metrics added
438
- metrics = DatadogMetrics (namespace = "test" )
438
+ metrics = DatadogMetrics (namespace = "test" , flush_to_log = True )
439
439
metrics .add_metric (name = "test_metric" , value = 1 )
440
440
metrics .flush_metrics ()
441
441
@@ -451,7 +451,7 @@ def test_metrics_enabled_with_dev_mode_false(monkeypatch, capsys):
451
451
monkeypatch .setenv ("POWERTOOLS_DEV" , "false" )
452
452
453
453
# WHEN metrics is initialized
454
- metrics = DatadogMetrics (namespace = "test" )
454
+ metrics = DatadogMetrics (namespace = "test" , flush_to_log = True )
455
455
metrics .add_metric (name = "test_metric" , value = 1 )
456
456
metrics .flush_metrics ()
457
457
@@ -467,7 +467,7 @@ def test_metrics_disabled_dev_mode_overrides_metrics_disabled(monkeypatch, capsy
467
467
monkeypatch .setenv ("POWERTOOLS_METRICS_DISABLED" , "false" )
468
468
469
469
# WHEN metrics is initialized
470
- metrics = DatadogMetrics (namespace = "test" )
470
+ metrics = DatadogMetrics (namespace = "test" , flush_to_log = True )
471
471
metrics .add_metric (name = "test_metric" , value = 1 )
472
472
metrics .flush_metrics ()
473
473
@@ -485,7 +485,7 @@ def test_metrics_enabled_with_both_false(monkeypatch, capsys):
485
485
monkeypatch .setenv ("POWERTOOLS_METRICS_DISABLED" , "false" )
486
486
487
487
# WHEN metrics is initialized
488
- metrics = DatadogMetrics (namespace = "test" )
488
+ metrics = DatadogMetrics (namespace = "test" , flush_to_log = True )
489
489
metrics .add_metric (name = "test_metric" , value = 1 )
490
490
metrics .flush_metrics ()
491
491
@@ -501,7 +501,7 @@ def test_metrics_disabled_with_dev_mode_false_and_metrics_disabled_true(monkeypa
501
501
monkeypatch .setenv ("POWERTOOLS_METRICS_DISABLED" , "true" )
502
502
503
503
# WHEN metrics is initialized
504
- metrics = DatadogMetrics (namespace = "test" )
504
+ metrics = DatadogMetrics (namespace = "test" , flush_to_log = True )
505
505
metrics .add_metric (name = "test_metric" , value = 1 )
506
506
metrics .flush_metrics ()
507
507
0 commit comments