Skip to content

Commit 698a6fd

Browse files
author
benoit-cty
committed
Add test
1 parent 8d19e19 commit 698a6fd

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/output_methods/metrics/test_prometheus.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ def test_out_method(self, mock_push_to_gateway):
5151
output = prometheus.PrometheusOutput("url")
5252
output.out(total=EMISSIONS_DATA, delta=EMISSIONS_DATA)
5353

54+
@patch("codecarbon.output_methods.metrics.prometheus.delete_from_gateway")
55+
def test_exit_method(self, mock_delete):
56+
output = prometheus.PrometheusOutput("url", job_name="custom_job")
57+
output.exit()
58+
mock_delete.assert_called_once_with("url", job="custom_job")
59+
5460
@patch(
5561
"codecarbon.output_methods.metrics.prometheus.push_to_gateway",
5662
side_effect=Exception("Test error"),

0 commit comments

Comments
 (0)