Skip to content

Commit

Permalink
registry.statsd is no-op by default
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Oct 28, 2024
1 parent 0d26967 commit b301080
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/core/test_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,12 @@ def test_statsd_counts_unknown_urls(self):
app.get("/v0/coucou", status=404)
self.assertFalse(self.mocked.count.called)

def test_metrics_and_statsd_are_none_if_statsd_url_not_set(self):
def test_statsd_is_noop_service_if_statsd_url_not_set(self):
self.config.add_settings({"statsd_url": None})

initialization.setup_metrics(self.config)

self.assertIsNone(self.config.registry.statsd)
self.assertIsNone(self.config.registry.metrics)
self.assertEqual(self.config.registry.statsd.__class__.__name__, "NoOpMetricsService")

def test_metrics_attr_is_set_if_statsd_url_is_set(self):
self.config.add_settings({"statsd_url": "udp://host:8080"})
Expand Down

0 comments on commit b301080

Please sign in to comment.