# -*- coding: utf-8 -*- """票 06 补测摘要:等 t06-test2.log 出 EXIT 行后打摘要。""" import io, sys, time sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') log = r'e:\code\crm-backend-matt\.scratch\opportunity-bugfix\t06-test2.log' deadline = time.time() + 240 txt = '' while time.time() < deadline: try: txt = open(log, encoding='utf-8', errors='replace').read() except FileNotFoundError: txt = '' if 'EXIT=' in txt: break time.sleep(8) print('waited', 'done' if 'EXIT=' in txt else 'TIMEOUT') for line in txt.splitlines(): if ('Tests run:' in line and 'Failures' in line) or line.startswith('BUILD') or 'EXIT=' in line \ or 'ERROR' in line.upper() and 'Tests run' not in line: if 'at com.crm' in line or '\tat ' in line: continue print(line.strip())