Skip to content

Commit

Permalink
tests/conftest.py: Get the template params from the actual template name
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
swick committed Jan 24, 2025
1 parent 0024f6c commit 3af9ddd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3af9ddd

Please sign in to comment.