Skip to content

Commit eb76779

Browse files
committed
chore: conda 环境迁移到 user_config.json + smoke test 补 check_updates
1 parent edd3c0f commit eb76779

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

QuantClass Sync.command

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,6 @@ if [ $? -ne 0 ]; then
122122
echo "程序异常退出,按任意键关闭..."
123123
read -n 1
124124
fi
125+
126+
# GUI 正常退出后,自动关闭本终端窗口(按名称匹配,不误关其他窗口)
127+
osascript -e 'tell application "Terminal" to close (every window whose name contains "QuantClass Sync")' &>/dev/null &

quantclass_sync_internal/gui/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ def launch_gui() -> None:
3535
)
3636
# 启动 pywebview 主循环(阻塞直到窗口关闭)
3737
webview.start(debug=False)
38+
39+
# 窗口已关闭,强制退出以防 pywebview 后台线程残留导致进程不退出
40+
import os as _os
41+
_os._exit(0)

tests/test_smoke.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ def test_s1_6_gui_mock_webview(self):
209209
patch sys.modules 即可在不安装 pywebview 的环境下测试。
210210
"""
211211
mock_webview = MagicMock()
212-
with patch.dict("sys.modules", {"webview": mock_webview}):
212+
with patch.dict("sys.modules", {"webview": mock_webview}), \
213+
patch("os._exit"): # launch_gui 结束时调用 os._exit(0)
213214
# 在 mock 生效后再调用,确保函数内 import webview 拿到 mock
214215
from quantclass_sync_internal.gui import launch_gui
215216
launch_gui()

0 commit comments

Comments
 (0)