Do not add parent only modules to strip sockets (#963)

Excludes modules that child devices report as supported but do not make sense
on a child device like firmware, cloud, time etc.
This commit is contained in:
Steven B
2024-06-10 06:21:21 +01:00
committed by GitHub
parent fe0bbf1b98
commit 9e74e1bd40
3 changed files with 43 additions and 5 deletions

View File

@@ -152,6 +152,24 @@ def parametrize_combine(parametrized: list[pytest.MarkDecorator]):
)
def parametrize_subtract(params: pytest.MarkDecorator, subtract: pytest.MarkDecorator):
"""Combine multiple pytest parametrize dev marks into one set of fixtures."""
if params.args[0] != "dev" or subtract.args[0] != "dev":
raise Exception(
f"Supplied mark is not for dev fixture: {params.args[0]} {subtract.args[0]}"
)
fixtures = []
for param in params.args[1]:
if param not in subtract.args[1]:
fixtures.append(param)
return pytest.mark.parametrize(
"dev",
sorted(fixtures),
indirect=True,
ids=idgenerator,
)
def parametrize(
desc,
*,