From 4c568c84f93ba1091d2f33e0366d9dbfa4405949 Mon Sep 17 00:00:00 2001 From: Lukas Pramuk Date: Wed, 6 May 2026 11:59:04 +0200 Subject: [PATCH] Allow host_conf usage w/o request fixture --- pytest_fixtures/core/contenthosts.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pytest_fixtures/core/contenthosts.py b/pytest_fixtures/core/contenthosts.py index f8096f2132c..9e9172fe98d 100644 --- a/pytest_fixtures/core/contenthosts.py +++ b/pytest_fixtures/core/contenthosts.py @@ -21,18 +21,18 @@ def host_conf(request): conf = params = {} if hasattr(request, 'param'): params = request.param + elif hasattr(request, 'get'): + params = request.get('param', {}) distro = params.get('distro', 'rhel') network = params.get('network', settings.content_host.network_type) _rhelver = f"{distro}{params.get('rhel_version', settings.content_host.default_rhel_version)}" # check to see if no-containers is passed as an argument to pytest deploy_kwargs = {} - if not any( - [ - request.config.getoption('no_containers'), - params.get('no_containers'), - request.node.get_closest_marker('no_containers'), - ] + if not ( + params.get('no_containers') + or request.config.getoption('no_containers') + or request.node.get_closest_marker('no_containers') ): deploy_kwargs = settings.content_host.get(_rhelver).to_dict().get('container', {}) if deploy_kwargs and network: