From 3af9dddc0b2335affd00a658d93099f8eca17226 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Fri, 17 Jan 2025 16:30:49 +0100 Subject: [PATCH] tests/conftest.py: Get the template params from the actual template name instead of the entire string which can contain other data, such as the bus name. Also adds an assert to ensure template is actually of type string which makes mypy happy. --- tests/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 259481409..01cd07bab 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -403,9 +403,10 @@ def templates( dbusmock.BusType.SYSTEM: {}, dbusmock.BusType.SESSION: {}, } - for template, params in required_templates.items(): + for template_data, params in required_templates.items(): + template, bus_name = (template_data.split(":") + [None])[:2] + assert template params = template_params.get(template, params) - template, bus_name = (template.split(":") + [None])[:2] _start_template(busses, template, bus_name, params) yield _terminate_servers(busses)