Updating run_scenario method to not launch new parallel tests

if top test is terminating.
This commit is contained in:
Vitaliy Zakaznikov 2021-05-11 17:17:08 -04:00
parent 042625a8e2
commit 2541f2cb25

View File

@ -96,7 +96,13 @@ def run_scenario(pool, tasks, scenario, kwargs=None):
if kwargs is None:
kwargs = {}
_top = top()
def _scenario_wrapper(**kwargs):
if _top.terminating:
return
return scenario(**kwargs)
if current().context.parallel:
start(pool, tasks, scenario, kwargs)
start(pool, tasks, _scenario_wrapper, kwargs)
else:
scenario(**kwargs)