From: Štěpán Balážik Date: Wed, 28 Jan 2026 00:03:10 +0000 (+0100) Subject: Set dist=loadscope for pytest in pytest.ini X-Git-Tag: v9.21.19~15^2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c47b0764948ac90d691ee95753a8d18e4fe1b0d2;p=thirdparty%2Fbind9.git Set dist=loadscope for pytest in pytest.ini Previously there was some handling of old pytest-xdist versions which is no longer needed. --- diff --git a/bin/tests/system/conftest.py b/bin/tests/system/conftest.py index 157dc9faca6..6be331b0e92 100644 --- a/bin/tests/system/conftest.py +++ b/bin/tests/system/conftest.py @@ -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 diff --git a/bin/tests/system/pytest.ini b/bin/tests/system/pytest.ini index 5574b3e6115..fce4abff246 100644 --- a/bin/tests/system/pytest.ini +++ b/bin/tests/system/pytest.ini @@ -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