@@ -67,14 +67,10 @@ def testAssertMetricEquals(self):
67
67
# First we test that a scalar metric can be tested.
68
68
self .test_case .assertMetricEquals (42 , "some_gauge" , registry = self .registry )
69
69
assert self .test_case .passes is True
70
- self .test_case .assertMetricEquals (43 , "some_gauge" , registry = self .registry )
71
- assert self .test_case .passes is False
72
- self .test_case .passes = True
70
+ self .test_case .assertMetricNotEquals (43 , "some_gauge" , registry = self .registry )
73
71
74
72
# Here we test that assertMetricEquals fails on nonexistent gauges.
75
- self .test_case .assertMetricEquals (42 , "some_nonexistent_gauge" , registry = self .registry )
76
- assert not self .test_case .passes
77
- self .test_case .passes = True
73
+ self .test_case .assertMetricNotEquals (42 , "some_nonexistent_gauge" , registry = self .registry )
78
74
79
75
# Here we test that labelled metrics can be tested.
80
76
self .test_case .assertMetricEquals (
@@ -85,15 +81,13 @@ def testAssertMetricEquals(self):
85
81
labelblue = "indigo" ,
86
82
)
87
83
assert self .test_case .passes is True
88
- self .test_case .assertMetricEquals (
84
+ self .test_case .assertMetricNotEquals (
89
85
1 ,
90
86
"some_labelled_gauge" ,
91
87
registry = self .registry ,
92
88
labelred = "tomato" ,
93
89
labelblue = "sky" ,
94
90
)
95
- assert self .test_case .passes is False
96
- self .test_case .passes = True
97
91
98
92
def testRegistrySaving (self ):
99
93
"""Tests saveRegistry and frozen registries operations."""
0 commit comments