File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ def init():
4545 cov_config = os .environ .get ('COV_CORE_CONFIG' )
4646 cov_datafile = os .environ .get ('COV_CORE_DATAFILE' )
4747 cov_branch = True if os .environ .get ('COV_CORE_BRANCH' ) == 'enabled' else None
48+ cov_context = os .environ .get ('COV_CORE_CONTEXT' )
4849
4950 if cov_datafile :
5051 if _active_cov :
@@ -71,6 +72,8 @@ def init():
7172 )
7273 cov .load ()
7374 cov .start ()
75+ if cov_context :
76+ cov .switch_context (cov_context )
7477 cov ._warn_no_data = False
7578 cov ._warn_unimported_source = False
7679 return cov
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ def unset_env():
110110 os .environ .pop ('COV_CORE_CONFIG' , None )
111111 os .environ .pop ('COV_CORE_DATAFILE' , None )
112112 os .environ .pop ('COV_CORE_BRANCH' , None )
113+ os .environ .pop ('COV_CORE_CONTEXT' , None )
113114
114115 @staticmethod
115116 def get_node_desc (platform , version_info ):
Original file line number Diff line number Diff line change @@ -356,6 +356,7 @@ def pytest_runtest_call(self, item):
356356 def switch_context (self , item , when ):
357357 context = "{item.nodeid}|{when}" .format (item = item , when = when )
358358 self .cov .switch_context (context )
359+ os .environ ['COV_CORE_CONTEXT' ] = context
359360
360361
361362@pytest .fixture
You can’t perform that action at this time.
0 commit comments