def env(request, init_fname, test_results, tmp_workdir, external_log):
workdir = os.path.join(str(tmp_workdir), 'lago')
env = sdk.init(
init_fname,
workdir=workdir,
logfile=str(external_log),
loglevel=logging.DEBUG,
)
env.start()
try:
yield env
collect_path = os.path.join(test_results, 'collect')
env.collect_artifacts(output_dir=collect_path, ignore_nopath=True)
shutil.copytree(
workdir,
os.path.join(test_results, 'workdir'),
ignore=shutil.ignore_patterns('*images*')
)
finally:
env.stop()
env.destroy()
评论列表
文章目录