From 419354cb07f3f71cdce5c7e9165ba2a9b4a5d416 Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Sun, 26 Nov 2023 17:42:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E7=8E=87=E6=B5=8B=E8=AF=95=E7=9A=84=E9=80=80?= =?UTF-8?q?=E5=87=BA=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 1a96f1a4..36865e13 100644 --- a/main.py +++ b/main.py @@ -463,12 +463,19 @@ def main(): except: stop() pkg.utils.context.get_thread_ctl().shutdown() - import platform - if platform.system() == 'Windows': - cmd = "taskkill /F /PID {}".format(os.getpid()) - elif platform.system() in ['Linux', 'Darwin']: - cmd = "kill -9 {}".format(os.getpid()) - os.system(cmd) + + launch_args = sys.argv.copy() + + if "--cov-report" not in launch_args: + import platform + if platform.system() == 'Windows': + cmd = "taskkill /F /PID {}".format(os.getpid()) + elif platform.system() in ['Linux', 'Darwin']: + cmd = "kill -9 {}".format(os.getpid()) + os.system(cmd) + else: + print("正常退出以生成覆盖率报告") + sys.exit(0) if __name__ == '__main__':