取消pytest.main()进程的运行

问题描述 投票:0回答:1

我从flask服务运行pytest。我有一个用pytest.main包装插件的函数我运行pytest.main与 self.executor = ThreadPoolExecutor(max_workers=1) self.executor.submit(pytest.main...)

我想在后台工作程序(另一个线程)中运行pytest.main,这样主线程就不会卡住。我想增加使用session.shouldstop = True或pytest.exit()停止测试运​​行的可能性但是当我这样做时,什么都没有发生,测试仍然可以运行。有什么解决方案或解决此问题的另一种方法?

python pytest future pytest-xdist
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.