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

Function _expect_metric_exception

tests/test_exposition.py:468–476  ·  view source on GitHub ↗
(registry, expected_error)

Source from the content-addressed store, hash-verified

466
467
468def _expect_metric_exception(registry, expected_error):
469 try:
470 generate_latest(registry, openmetrics.ALLOWUTF8)
471 except expected_error as exception:
472 assert isinstance(exception.args[-1], core.Metric)
473 # Got a valid error as expected, return quietly
474 return
475
476 raise RuntimeError('Expected exception not raised')
477
478
479@pytest.mark.parametrize('MetricFamily', [

Callers 3

Calls 1

generate_latestFunction · 0.90

Tested by

no test coverage detected