fix: clear late owned startup tips after normal close
This commit is contained in:
1 parent
4402486baa
commit
a64636ba0d
4 files changed
+278
-6
No files matched your search
@@ -7,8 +7,9 @@ from cbb_refresh_verify import failed_session, mentor_adapter
|
||||
|
||||
|
||||
def startup_fixture(tmp_path, monkeypatch):
|
||||
import win32gui, win32process
|
||||
from cbb_refresh_verify import native_repair_ui
|
||||
from contextlib import nullcontext
|
||||
import win32gui, win32process, win32event, win32con
|
||||
from cbb_refresh_verify import native_repair_ui, residual_sessions
|
||||
job = {'root': str(tmp_path), 'pcb': str(tmp_path/'PCB/CBB.pcb'),
|
||||
'project': str(tmp_path/'CBB.prj'), 'lmc_file': str(tmp_path/'lib.lmc'),
|
||||
'desktop': 'CbbVerify_test'}
|
||||
@@ -20,6 +21,12 @@ def startup_fixture(tmp_path, monkeypatch):
|
||||
records = [(12, r'C:\Mentor\wg\ExpeditionPCB.exe',
|
||||
f'ExpeditionPCB.exe "{job["pcb"]}" -ReusableCircuit', 11)]
|
||||
monkeypatch.setattr(mentor_adapter, '_process_details', lambda _: list(records))
|
||||
monkeypatch.setattr(residual_sessions, '_process_handle', lambda *a, **kw: nullcontext(123))
|
||||
monkeypatch.setattr(residual_sessions, '_handle_identity', lambda h:
|
||||
{'created_handle': 'original', 'image': r'C:\Mentor\wg\ExpeditionPCB.exe'})
|
||||
monkeypatch.setattr(residual_sessions, '_process_windows', lambda pids: {12: []})
|
||||
monkeypatch.setattr(win32event, 'WaitForSingleObject', lambda *a:
|
||||
win32con.WAIT_TIMEOUT if records else win32con.WAIT_OBJECT_0)
|
||||
monkeypatch.setattr(native_repair_ui, '_current_desktop_name', lambda: 'CbbVerify_test')
|
||||
monkeypatch.setattr(win32gui, 'EnumWindows', lambda fn, arg: fn(100, arg))
|
||||
monkeypatch.setattr(win32gui, 'EnumChildWindows', lambda *args: None)
|
||||
|
||||
Reference in new issue
Block a user