How to select from multiple targets in a single environment yaml file? #1246
Replies: 1 comment 3 replies
-
There is support for multiple targets: A target is constructed from the environment config via labgrid/labgrid/pytestplugin/fixtures.py Lines 119 to 127 in 6872745 As you can see there, @pytest.fixture(scope="session")
def target_a(env):
"""Return the target `a` configured in the supplied configuration file."""
target = env.get_target("a")
if target is None:
raise UserError("Using target_a fixture without 'a' target in config")
return target |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd love to use pytest's built in test collection to run all my tests with a single pytest command, but the various tests use different targets. I can only pass one yaml file to pytest with
--lg-env
so I figured I could put all the targets into the one yaml file and each test could specify which target it wants. The documentation and the structure of the yaml seems to show support for more than one target in the yaml:But I see no examples of having anything other than a single target named "main" in the documentation or in the labgrid code examples. I tried putting two targets in a single yaml file and it seems like the second gets used by pytest by default. Is there a way to do what I'm trying to do?
Beta Was this translation helpful? Give feedback.
All reactions