diff --git a/radicale/tests/__init__.py b/radicale/tests/__init__.py index 21bf277..bb8e586 100644 --- a/radicale/tests/__init__.py +++ b/radicale/tests/__init__.py @@ -19,15 +19,25 @@ Tests for Radicale. """ +import logging import os import sys from io import BytesIO sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) +logger = logging.getLogger("radicale_test") +if not logger.hasHandlers(): + handler = logging.StreamHandler(sys.stderr) + handler.setFormatter(logging.Formatter("%(levelname)s: %(message)s")) + logger.addHandler(handler) +logger.setLevel(logging.DEBUG) + class BaseTest: """Base class for tests.""" + logger = logger + def request(self, method, path, data=None, **args): """Send a request.""" self.application._status = None diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index 1545c4b..3e9b8b6 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -20,7 +20,6 @@ Radicale tests with simple requests. """ import base64 -import logging import os import posixpath import shutil @@ -868,7 +867,6 @@ class BaseFileSystemTest(BaseTest): def setup(self): self.configuration = config.load() self.configuration.set("storage", "type", self.storage_type) - self.logger = logging.getLogger("radicale_test") self.colpath = tempfile.mkdtemp() self.configuration.set("storage", "filesystem_folder", self.colpath) # Disable syncing to disk for better performance