def execute_with_output(check: Check) -> CheckResult: print_processing(check.msg) try: result = check.execute() finally: stop_processing_spinner() if result.result == result.should_succeed: print_passed(check.msg) else: print_failed(check.msg, result.warning, result.output, result.command) return result
def record_result(result, msg, output, warning, should_succeed=True, command=None, mandatory=False): global results stop_processing_spinner() results.append((result, should_succeed, mandatory)) if result == should_succeed: print_passed(msg) else: print_failed(msg, command, output, warning)