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