]> 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)
committerMichał Kępień <michal@isc.org>
Wed, 20 Mar 2024 08:22:36 +0000 (09:22 +0100)
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.

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

index 2ada221b910d7873c5d2d302b41ea4d0f8d23863..0558bfd68a7f370d78f1aae7461e7f7ffc5f7fc8 100644 (file)
@@ -30,6 +30,9 @@ import isctest
 # pylint: disable=redefined-outer-name
 
 
+isctest.log.init_conftest_logger()
+isctest.log.avoid_duplicated_logs()
+
 # ----------------- Older pytest / xdist compatibility -------------------
 # As of 2023-01-11, the minimal supported pytest / xdist versions are
 # determined by what is available in EL8/EPEL8:
index 5f285577c2b21c22da2970a2b414cbd1ac35be1e..5975ae789269d7771bec45d3c7228b5c1cdce73f 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 81991d4318218aa0b3b225c673d5266c033a381a..b3987b27f95faa5e7bb94d6b475c7559be2c012a 100644 (file)
@@ -53,10 +53,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()