DataDog / datadogpy

The Datadog Python library
https://datadoghq.com/
Other
609 stars 303 forks source link

Mock statsd during tests #753

Closed meghaddn closed 1 year ago

meghaddn commented 1 year ago

Hi,

I am trying to Mock/disable datadog statsd during tests. I am able to mock the socket but my metrics increment calls are not getting mocked. Any help appreciated in how to mock the counter increment calls. Thanks!

from datadog import statsd
from mock import Mock

statsd.socket = Mock()