File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 1+ # HELP pytest_tests_run_total Total number of tests run by pytest
2+ # TYPE pytest_tests_run_total counter
3+ pytest_tests_run_total{test_name="test_metrics__return_expected"} 1.0
Original file line number Diff line number Diff line change 22import pytest
33from rest_framework .test import APIClient
44
5+ from common .test_tools import SnapshotFixture
6+
57
68def test_liveness_probe__return_expected (
79 client : APIClient ,
@@ -15,6 +17,7 @@ def test_liveness_probe__return_expected(
1517def test_metrics__return_expected (
1618 test_metric : prometheus_client .Counter ,
1719 client : APIClient ,
20+ snapshot : SnapshotFixture ,
1821) -> None :
1922 # Arrange
2023 test_metric .labels (test_name = "test_metrics__return_expected" ).inc ()
@@ -24,13 +27,4 @@ def test_metrics__return_expected(
2427
2528 # Assert
2629 assert response .status_code == 200
27- assert response .content == (
28- "\n " .join (
29- [
30- "# HELP pytest_tests_run_total Total number of tests run by pytest" ,
31- "# TYPE pytest_tests_run_total counter" ,
32- 'pytest_tests_run_total{test_name="test_metrics__return_expected"} 1.0' ,
33- "" ,
34- ]
35- ).encode ()
36- )
30+ assert response .content .decode () == snapshot ()
You can’t perform that action at this time.
0 commit comments