]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Move isctest.var initialization to conftest.py
authorNicki Křížek <nicki@isc.org>
Mon, 6 May 2024 14:55:42 +0000 (16:55 +0200)
committerNicki Křížek <nicki@isc.org>
Thu, 9 May 2024 15:08:11 +0000 (17:08 +0200)
The environment variable initialization requires logging to be set up
first. Ensure the initialization is delayed until loggers have been set
up.

bin/tests/system/conftest.py
bin/tests/system/isctest/vars/__init__.py

index 77b1948eaf93bd5fb6c78564002225c15569ead7..5585d1e402ca0d3849cb07396f25059e4fd76baf 100644 (file)
@@ -33,6 +33,7 @@ from isctest.vars.dirs import SYSTEM_TEST_DIR_GIT_PATH
 
 isctest.log.init_conftest_logger()
 isctest.log.avoid_duplicated_logs()
+isctest.vars.init_vars()
 
 # ----------------- Older pytest / xdist compatibility -------------------
 # As of 2023-01-11, the minimal supported pytest / xdist versions are
index d4e26a892f32dfe08b8d640236b4ff0e669cd257..7c06a247a2d0316fdb3b47aab11f7a36a8aa18a2 100644 (file)
@@ -16,8 +16,9 @@ from .openssl import parse_openssl_config
 from .. import log
 
 
-# env variable initialization
-parse_openssl_config(ALL["OPENSSL_CONF"])
+def init_vars():
+    """Initializes the environment variables."""
+    parse_openssl_config(ALL["OPENSSL_CONF"])
 
-os.environ.update(ALL)
-log.debug("setting following env vars: %s", ", ".join([str(key) for key in ALL]))
+    os.environ.update(ALL)
+    log.debug("setting following env vars: %s", ", ".join([str(key) for key in ALL]))