mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 03:32:33 +08:00
feat: 添加用于覆盖率测试的退出代码
This commit is contained in:
parent
7708eaa82c
commit
419354cb07
7
main.py
7
main.py
|
@ -463,12 +463,19 @@ def main():
|
||||||
except:
|
except:
|
||||||
stop()
|
stop()
|
||||||
pkg.utils.context.get_thread_ctl().shutdown()
|
pkg.utils.context.get_thread_ctl().shutdown()
|
||||||
|
|
||||||
|
launch_args = sys.argv.copy()
|
||||||
|
|
||||||
|
if "--cov-report" not in launch_args:
|
||||||
import platform
|
import platform
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
cmd = "taskkill /F /PID {}".format(os.getpid())
|
cmd = "taskkill /F /PID {}".format(os.getpid())
|
||||||
elif platform.system() in ['Linux', 'Darwin']:
|
elif platform.system() in ['Linux', 'Darwin']:
|
||||||
cmd = "kill -9 {}".format(os.getpid())
|
cmd = "kill -9 {}".format(os.getpid())
|
||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
|
else:
|
||||||
|
print("正常退出以生成覆盖率报告")
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user