File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 77from ..resource .remote import RemotePlace
88from ..util .ssh import sshmanager
99from ..logging import DEFAULT_FORMAT
10+ from .hooks import LABGRID_ENV_KEY
1011
1112# pylint: disable=redefined-outer-name
1213
@@ -60,7 +61,7 @@ def env(request, record_testsuite_property):
6061 """Return the environment configured in the supplied configuration file.
6162 It contains the targets contained in the configuration file.
6263 """
63- env = request .config ._labgrid_env
64+ env = request .config .stash [ LABGRID_ENV_KEY ]
6465
6566 if not env :
6667 pytest .skip ("missing environment config (use --lg-env)" )
Original file line number Diff line number Diff line change 88from ..util .helper import processwrapper
99from ..logging import StepFormatter , StepLogger
1010
11+ LABGRID_ENV_KEY = pytest .StashKey [Environment ]()
12+
13+
1114@pytest .hookimpl (tryfirst = True )
1215def pytest_cmdline_main (config ):
1316 def set_cli_log_level (level ):
@@ -89,15 +92,15 @@ def pytest_configure(config):
8992 env = Environment (config_file = lg_env )
9093 if lg_coordinator is not None :
9194 env .config .set_option ('crossbar_url' , lg_coordinator )
92- config ._labgrid_env = env
95+ config .stash [ LABGRID_ENV_KEY ] = env
9396
9497 processwrapper .enable_logging ()
9598
9699@pytest .hookimpl ()
97100def pytest_collection_modifyitems (config , items ):
98101 """This function matches function feature flags with those found in the
99102 environment and disables the item if no match is found"""
100- env = config ._labgrid_env
103+ env = config .stash [ LABGRID_ENV_KEY ]
101104
102105 if not env :
103106 return
You can’t perform that action at this time.
0 commit comments