From dfa7ffc0b31292d3369b7ceaaa403ec9ff1cb019 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Fri, 3 Apr 2026 07:17:12 +0200 Subject: [PATCH] server/delay_on_error: add code to trigger for testing --- radicale/app/options.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/radicale/app/options.py b/radicale/app/options.py index 9e347de2..b4c1c29c 100644 --- a/radicale/app/options.py +++ b/radicale/app/options.py @@ -18,6 +18,7 @@ # You should have received a copy of the GNU General Public License # along with Radicale. If not, see . +import os from http import client from radicale import httputils, types @@ -33,4 +34,7 @@ class ApplicationPartOptions(ApplicationBase): "Allow": ", ".join( name[3:] for name in dir(self) if name.startswith("do_")), "DAV": httputils.DAV_HEADERS} + if 'PYTEST_VERSION' in os.environ and 'PYTEST_RADICALE_RAISE_GENERIC_ERROR' in os.environ: + # trigger special test case + raise ValueError('PYTEST_RADICALE_RAISE_GENERIC_ERROR') return client.OK, headers, None, None