From 60fb5063484275a6c6b76060ebf92f2cb5ba8063 Mon Sep 17 00:00:00 2001
From: "i.nueske" <i.nueske@indiscale.com>
Date: Sun, 8 Dec 2024 19:47:53 +0100
Subject: [PATCH] TST: Fix timeout reset in test_gitlab_com_127

---
 tests/test_issues_pylib.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/test_issues_pylib.py b/tests/test_issues_pylib.py
index 739726d..56fb6ad 100644
--- a/tests/test_issues_pylib.py
+++ b/tests/test_issues_pylib.py
@@ -207,10 +207,13 @@ def test_gitlab_com_127():
     See https://gitlab.com/linkahead/linkahead-pylib/-/issues/127 and
     https://gitlab.indiscale.com/caosdb/customers/f-fit/management/-/issues/93
     """
-    # Setup paths
+    # Setup paths and save previous timeout
     base_dir = Path(__file__).parent.parent
     temp_pylinkahead_path = base_dir/'.pyla-temp-test.ini'
     temp_pylinkahead_path.unlink(True)
+    prev_timeout = None
+    if db.get_config().has_option('Connection', 'timeout'):
+        prev_timeout = db.get_config().get('Connection', 'timeout')
 
     # Parse various timeout strings and check successful connect
     valid_timeout_strings = ["timeout = None", "timeout=null",
@@ -231,4 +234,6 @@ def test_gitlab_com_127():
 
     # Reset configuration
     db.get_config().remove_option('Connection', 'timeout')
+    if prev_timeout is not None:
+        db.get_config().set('Connection', 'timeout', prev_timeout)
     db.configure_connection()
-- 
GitLab