diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py index d142661a1a..6c107d92b7 100644 --- a/test/unit/common/test_utils.py +++ b/test/unit/common/test_utils.py @@ -5526,6 +5526,8 @@ class TestStatsdLogging(unittest.TestCase): conf = {'log_statsd_host': 'another.host.com'} with warnings.catch_warnings(record=True) as cm: + if six.PY2: + getattr(utils, '__warningregistry__', {}).clear() warnings.resetwarnings() warnings.simplefilter('always', DeprecationWarning) logger = utils.get_logger(