From 0ea20ab038b8ba50fe2466997816ae6144b3ec21 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Sun, 5 Apr 2026 14:31:49 +0200 Subject: [PATCH 1/5] sharing/fix: indent bug --- radicale/item/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicale/item/__init__.py b/radicale/item/__init__.py index 71f174e6..cef24d15 100644 --- a/radicale/item/__init__.py +++ b/radicale/item/__init__.py @@ -512,14 +512,14 @@ class Item: if self.vobject_item.name != "VCARD": if logger.isEnabledFor(logging.DEBUG): logger.debug("TRACE/item/convert_vcf_to_ics: item is not a VCARD (skip): %r", self.href) - return None + return None else: if logger.isEnabledFor(logging.DEBUG): logger.debug("TRACE/item/convert_vcf_to_ics: item is a VCARD (ok): %r", self.href) if not hasattr(self.vobject_item, "bday"): if logger.isEnabledFor(logging.DEBUG): logger.debug("TRACE/item/convert_vcf_to_ics: miss bday (skip): %r", self.href) - return None + return None else: pass From cd98d0fd9bc2be427507c2d6f6215e9e45da0590 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Sun, 5 Apr 2026 16:13:04 +0200 Subject: [PATCH 2/5] storage/hook/tests: skip if loglevel is not DEBUG and set explicit capture of DEBUG log --- radicale/tests/test_storage.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/radicale/tests/test_storage.py b/radicale/tests/test_storage.py index 70248504..9414108a 100644 --- a/radicale/tests/test_storage.py +++ b/radicale/tests/test_storage.py @@ -189,8 +189,10 @@ class TestMultiFileSystem(BaseTest): assert "\r\nUID:%s\r\n" % uid in answer @pytest.mark.skipif(not shutil.which("flock"), reason="flock command not found") + @pytest.mark.skipif(radicale.log.logger.getEffectiveLevel() == logging.INFO, reason="requires loglevel DEBUG") def test_hook_placeholders_PUT(self, caplog) -> None: - """Run hook and check placeholders: PUT""" + """Run hook and check placeholders via debug log: PUT""" + caplog.set_level(logging.DEBUG) self.configure({"storage": {"hook": "echo \"hook-json {'user':'%(user)s', 'cwd':'%(cwd)s', 'path':'%(path)s', 'request':'%(request)s', 'to_path':'%(to_path)s'}\""}}) found = 0 self.mkcalendar("/calendar.ics/") @@ -230,8 +232,10 @@ class TestMultiFileSystem(BaseTest): logging.info("Logging contains expected hook line, found=%d data=%r", found, d) @pytest.mark.skipif(not shutil.which("flock"), reason="flock command not found") + @pytest.mark.skipif(radicale.log.logger.getEffectiveLevel() == logging.INFO, reason="requires loglevel DEBUG") def test_hook_placeholders_DELETE(self, caplog) -> None: - """Run hook and check placeholders: DELETE""" + """Run hook and check placeholders via debug log: DELETE""" + caplog.set_level(logging.DEBUG) self.configure({"storage": {"hook": "echo \"hook-json {'user':'%(user)s', 'cwd':'%(cwd)s', 'path':'%(path)s', 'request':'%(request)s', 'to_path':'%(to_path)s'}\""}}) found = 0 self.mkcalendar("/calendar.ics/") @@ -272,8 +276,10 @@ class TestMultiFileSystem(BaseTest): logging.info("Logging contains expected hook line, found=%d data=%r", found, d) @pytest.mark.skipif(not shutil.which("flock"), reason="flock command not found") + @pytest.mark.skipif(radicale.log.logger.getEffectiveLevel() == logging.INFO, reason="requires loglevel DEBUG") def test_hook_placeholders_MKCALENDAR(self, caplog) -> None: - """Run hook and check placeholders: MKCALENDAR""" + """Run hook and check placeholders via debug log: MKCALENDAR""" + caplog.set_level(logging.DEBUG) self.configure({"storage": {"hook": "echo \"hook-json {'user':'%(user)s', 'cwd':'%(cwd)s', 'path':'%(path)s', 'request':'%(request)s', 'to_path':'%(to_path)s'}\""}}) found = 0 self.mkcalendar("/calendar.ics/") @@ -310,8 +316,10 @@ class TestMultiFileSystem(BaseTest): logging.info("Logging contains expected hook line, found=%d data=%r", found, d) @pytest.mark.skipif(not shutil.which("flock"), reason="flock command not found") + @pytest.mark.skipif(radicale.log.logger.getEffectiveLevel() == logging.INFO, reason="requires loglevel DEBUG") def test_hook_placeholders_MKCOL(self, caplog) -> None: - """Run hook and check placeholders: MKCOL""" + """Run hook and check placeholders via debug log: MKCOL""" + caplog.set_level(logging.DEBUG) self.configure({"storage": {"hook": "echo \"hook-json {'user':'%(user)s', 'cwd':'%(cwd)s', 'path':'%(path)s', 'request':'%(request)s', 'to_path':'%(to_path)s'}\""}}) found = 0 self.mkcol("/user1/") @@ -348,8 +356,10 @@ class TestMultiFileSystem(BaseTest): logging.info("Logging contains expected hook line, found=%d data=%r", found, d) @pytest.mark.skipif(not shutil.which("flock"), reason="flock command not found") + @pytest.mark.skipif(radicale.log.logger.getEffectiveLevel() == logging.INFO, reason="requires loglevel DEBUG") def test_hook_placeholders_PROPPATCH(self, caplog) -> None: - """Run hook and check placeholders: PROPPATCH""" + """Run hook and check placeholders via debug log: PROPPATCH""" + caplog.set_level(logging.DEBUG) self.configure({"storage": {"hook": "echo \"hook-json {'user':'%(user)s', 'cwd':'%(cwd)s', 'path':'%(path)s', 'request':'%(request)s', 'to_path':'%(to_path)s'}\""}}) found = 0 self.mkcalendar("/calendar.ics/") @@ -388,8 +398,10 @@ class TestMultiFileSystem(BaseTest): logging.info("Logging contains expected hook line, found=%d data=%r", found, d) @pytest.mark.skipif(not shutil.which("flock"), reason="flock command not found") + @pytest.mark.skipif(radicale.log.logger.getEffectiveLevel() == logging.INFO, reason="requires loglevel DEBUG") def test_hook_placeholders_MOVE(self, caplog) -> None: - """Run hook and check placeholders: MOVE""" + """Run hook and check placeholders via debug log: MOVE""" + caplog.set_level(logging.DEBUG) self.configure({"storage": {"hook": "echo \"hook-json {'user':'%(user)s', 'cwd':'%(cwd)s', 'path':'%(path)s', 'request':'%(request)s', 'to_path':'%(to_path)s'}\""}}) found = 0 self.mkcalendar("/calendar.ics/") From bd15df3d8a1f5e755d52fd2a8534d128be6b3eb5 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Sun, 5 Apr 2026 16:17:18 +0200 Subject: [PATCH 3/5] test: add support for custom radicale loglevel --- radicale/tests/__init__.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/radicale/tests/__init__.py b/radicale/tests/__init__.py index 4920fe37..911e0629 100644 --- a/radicale/tests/__init__.py +++ b/radicale/tests/__init__.py @@ -42,8 +42,18 @@ from radicale import app, config, types, utils, xmlutils RESPONSES = Dict[str, Union[int, Dict[str, Tuple[int, ET.Element]], vobject.base.Component]] -# Enable debug output -radicale.log.logger.setLevel(logging.DEBUG) +if 'PYTEST_RADICALE_LOGLEVEL' in os.environ: + # Set custom loglevel + level = os.environ["PYTEST_RADICALE_LOGLEVEL"] + logging.info("Setting loglevel by environment (PYTEST_RADICALE_LOGLEVEL): %s", level) +else: + # Default level + level = "debug" + logging.info("Setting loglevel by default: %s", level) +if isinstance(level, str): + level = getattr(logging, level.upper()) + assert isinstance(level, int) +radicale.log.logger.setLevel(level) class BaseTest: From 23d8f66a30435dc5010c84b0546be25623018631 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Sun, 5 Apr 2026 16:17:52 +0200 Subject: [PATCH 4/5] tests: extend with additional info-only log levels --- pyproject.toml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 767e4924..2b2de192 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ build-backend = "setuptools.build_meta" [tool.tox] min_version = "4.0" -envlist = ["py", "flake8", "isort", "mypy", "integ_test", "html5validator"] +envlist = ["py_loglevel_info", "py_radicale_loglevel_info", "py", "flake8", "isort", "mypy", "integ_test", "html5validator"] [tool.tox.env.py] extras = ["test"] @@ -65,6 +65,21 @@ deps = [ ] commands = [["pytest", "-r", "s", "--cov", "--cov-report=term", "--cov-report=xml", "."]] +[tool.tox.env.py_loglevel_info] +extras = ["test"] +deps = [ + "pytest" +] +commands = [["pytest", "-r", "s", "--log-level", "INFO", "."]] + +[tool.tox.env.py_radicale_loglevel_info] +extras = ["test"] +setenv = { PYTEST_RADICALE_LOGLEVEL = "info" } +deps = [ + "pytest" +] +commands = [["pytest", "-r", "s", "--log-level", "INFO", "."]] + [tool.tox.env.flake8] deps = ["flake8==7.1.0"] commands = [["flake8", "."]] From 9aa3e9718813f3e01446732b173374327a9f6c19 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Sun, 5 Apr 2026 16:43:17 +0200 Subject: [PATCH 5/5] related changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8dc6498..c080f16d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## 3.7.1.dev +* Fix: share address book collection as birthday calendar not working on non-DEBUG level ## 3.7.0