You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also remove some dead code. The untaken branches claimed by coverage are
due to loops that always iterate at least once, or because state
machines only ever have known states.
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
Copy file name to clipboardExpand all lines: tests/openmetrics/test_exposition.py
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,12 @@ def test_counter_total(self):
48
48
self.assertEqual(b'# HELP cc A counter\n# TYPE cc counter\ncc_total 1.0\ncc_created 123.456\n# EOF\n',
49
49
generate_latest(self.registry))
50
50
51
+
deftest_counter_unit(self):
52
+
c=Counter('cc_seconds', 'A counter', registry=self.registry, unit="seconds")
53
+
c.inc()
54
+
self.assertEqual(b'# HELP cc_seconds A counter\n# TYPE cc_seconds counter\n# UNIT cc_seconds seconds\ncc_seconds_total 1.0\ncc_seconds_created 123.456\n# EOF\n',
0 commit comments