]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Move conftest log initialization to conftest.py
authorTom Krizek <tkrizek@isc.org>
Wed, 13 Mar 2024 17:18:42 +0000 (18:18 +0100)
committerNicki Křížek <nicki@isc.org>
Mon, 20 Apr 2026 08:29:16 +0000 (10:29 +0200)
Initializing the conftest logging upon importing the isctest package
isn't practical when there are standalone pieces which can be used
outside of the testing framework, such as the asyncdnsserver module.

(cherry picked from commit 673387c4d515ecd1dd5dd6d854e629907b914970)

bin/tests/system/conftest.py
bin/tests/system/isctest/log/__init__.py
bin/tests/system/isctest/log/basic.py

index 2f84bb108b6cab1383589d28e2fa4663a52fbef4..ee792fb0a85196b1afce5dbb01b6cc77fe94bdca 100644 (file)
@@ -33,6 +33,9 @@ import isctest
 if sys.version_info[1] < 10:
     raise RuntimeError("Python 3.10 or newer is required to run system tests.")
 
+isctest.log.init_conftest_logger()
+isctest.log.avoid_duplicated_logs()
+
 # ----------------------- Globals definition -----------------------------
 
 XDIST_WORKER = os.environ.get("PYTEST_XDIST_WORKER", "")
index 702a9562d03c1c4a419b9eb55a03f81fced104c4..228f69e5bfa7bdadb6479b99d9a5f44f49f9b66f 100644 (file)
 # information regarding copyright ownership.
 
 from .basic import (
+    avoid_duplicated_logs,
     deinit_module_logger,
     deinit_test_logger,
+    init_conftest_logger,
     init_module_logger,
     init_test_logger,
     debug,
index 41b5ee68a1fbe5b62e5331d511e68a481d92af93..41988e9cbcaeb025e3c36ef7b7b15a1152c7d1ed 100644 (file)
@@ -54,10 +54,6 @@ def avoid_duplicated_logs():
         logging.root.handlers.remove(handler)
 
 
-init_conftest_logger()
-avoid_duplicated_logs()
-
-
 def init_module_logger(system_test_name: str, testdir: Path):
     logger = logging.getLogger(system_test_name)
     logger.handlers.clear()