mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-21 06:48:05 +00:00
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:
@@ -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,
|
||||
*,
|
||||
|
Reference in New Issue
Block a user