MCPcopy Index your code
hub / github.com/prometheus/client_python / test_function_decorator

Method test_function_decorator

tests/test_core.py:459–471  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

457 self.assertEqual(2, self.registry.get_sample_value('hl_sum', {'l': 'a'}))
458
459 def test_function_decorator(self):
460 self.assertEqual(0, self.registry.get_sample_value('h_count'))
461 self.assertEqual(0, self.registry.get_sample_value('h_bucket', {'le': '+Inf'}))
462
463 @self.histogram.time()
464 def f():
465 pass
466
467 self.assertEqual(([], None, None, None), getargspec(f))
468
469 f()
470 self.assertEqual(1, self.registry.get_sample_value('h_count'))
471 self.assertEqual(1, self.registry.get_sample_value('h_bucket', {'le': '+Inf'}))
472
473 def test_function_decorator_multithread(self):
474 self.assertEqual(0, self.registry.get_sample_value('h_count'))

Callers

nothing calls this directly

Calls 3

getargspecFunction · 0.90
get_sample_valueMethod · 0.80
fFunction · 0.50

Tested by

no test coverage detected