diff options
Diffstat (limited to 'test/__init__.py')
-rw-r--r-- | test/__init__.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/__init__.py b/test/__init__.py index da1069f..f91d0fa 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -4,3 +4,14 @@ if sys.version_info < (2, 7): import unittest2 as unittest # pylint: disable=import-error else: import unittest + +# Set default logging handler to avoid "No handler found" warnings. +import logging +try: # Python 2.7+ + from logging import NullHandler +except ImportError: + class NullHandler(logging.Handler): + def emit(self, record): + pass + +logging.getLogger(__name__).addHandler(NullHandler()) |