]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Set dist=loadscope for pytest in pytest.ini
authorŠtěpán Balážik <stepan@isc.org>
Wed, 28 Jan 2026 00:03:10 +0000 (01:03 +0100)
committerŠtěpán Balážik <stepan@isc.org>
Fri, 20 Feb 2026 14:17:31 +0000 (15:17 +0100)
Previously there was some handling of old pytest-xdist versions which is
no longer needed.

bin/tests/system/conftest.py
bin/tests/system/pytest.ini

index 157dc9faca69ee31aae9382e18d8e31e65121d44..6be331b0e929bfb6f5dffff72f6184cfcd350246 100644 (file)
@@ -41,7 +41,6 @@ isctest.vars.init_vars()
 
 # ----------------------- Globals definition -----------------------------
 
-XDIST_WORKER = os.environ.get("PYTEST_XDIST_WORKER", "")
 FILE_DIR = os.path.abspath(Path(__file__).parent)
 ENV_RE = Re(b"([^=]+)=(.*)")
 PRIORITY_TESTS = [
@@ -77,25 +76,6 @@ def pytest_addoption(parser):
     )
 
 
-def pytest_configure(config):
-    # Ensure this hook only runs on the main pytest instance if xdist is
-    # used to spawn other workers.
-    if not XDIST_WORKER:
-        if config.pluginmanager.has_plugin("xdist") and config.option.numprocesses:
-            # system tests depend on module scope for setup & teardown
-            # enforce use "loadscope" scheduler or disable paralelism
-            try:
-                import xdist.scheduler.loadscope  # pylint: disable=unused-import
-            except ImportError:
-                isctest.log.debug(
-                    "xdist is too old and does not have "
-                    "scheduler.loadscope, disabling parallelism"
-                )
-                config.option.dist = "no"
-            else:
-                config.option.dist = "loadscope"
-
-
 def pytest_ignore_collect(collection_path):
     # System tests are executed in temporary directories inside
     # bin/tests/system. These temporary directories contain all files
index 5574b3e61150f827b425197a20bb6e726ad54c17..fce4abff246b1c58b2b20464f654325e07c23d2c 100644 (file)
@@ -10,7 +10,7 @@
 # information regarding copyright ownership.
 
 [pytest]
-addopts = --tb=short -rA -vv
+addopts = --tb=short -rA -vv --dist=loadscope
 log_format = %(asctime)s %(levelname)s:%(name)s %(message)s
 log_date_format = %Y-%m-%d %H:%M:%S
 log_cli = 1