File tree 3 files changed +5
-0
lines changed 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ def init():
45
45
cov_config = os .environ .get ('COV_CORE_CONFIG' )
46
46
cov_datafile = os .environ .get ('COV_CORE_DATAFILE' )
47
47
cov_branch = True if os .environ .get ('COV_CORE_BRANCH' ) == 'enabled' else None
48
+ cov_context = os .environ .get ('COV_CORE_CONTEXT' )
48
49
49
50
if cov_datafile :
50
51
if _active_cov :
@@ -71,6 +72,8 @@ def init():
71
72
)
72
73
cov .load ()
73
74
cov .start ()
75
+ if cov_context :
76
+ cov .switch_context (cov_context )
74
77
cov ._warn_no_data = False
75
78
cov ._warn_unimported_source = False
76
79
return cov
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ def unset_env():
110
110
os .environ .pop ('COV_CORE_CONFIG' , None )
111
111
os .environ .pop ('COV_CORE_DATAFILE' , None )
112
112
os .environ .pop ('COV_CORE_BRANCH' , None )
113
+ os .environ .pop ('COV_CORE_CONTEXT' , None )
113
114
114
115
@staticmethod
115
116
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):
356
356
def switch_context (self , item , when ):
357
357
context = "{item.nodeid}|{when}" .format (item = item , when = when )
358
358
self .cov .switch_context (context )
359
+ os .environ ['COV_CORE_CONTEXT' ] = context
359
360
360
361
361
362
@pytest .fixture
You can’t perform that action at this time.
0 commit comments