def test_tween(config, handler): tween = pyramid_prometheus.tween_factory(handler, config.registry) req = testing.DummyRequest() req.matched_route = None got_resp = tween(req) #from prometheus_client import REGISTRY #for metric in REGISTRY.collect(): # assert metric.samples == 0 assert got_resp == req.response
def f(): return pyramid_prometheus.tween_factory(handler, config.registry)