| 44 | |
| 45 | |
| 46 | class Results: |
| 47 | def __init__(self, rc: ReportClient): |
| 48 | self.passed = 0 |
| 49 | self.failed = 0 |
| 50 | self.errors = [] |
| 51 | self.rc = rc |
| 52 | self.current_suite = "" |
| 53 | |
| 54 | def set_suite(self, suite: str): |
| 55 | self.current_suite = suite |
| 56 | |
| 57 | def ok(self, name, detail=""): |
| 58 | self.passed += 1 |
| 59 | suffix = f" ({detail})" if detail else "" |
| 60 | print(f" PASS {name}{suffix}") |
| 61 | self.rc.report(self.current_suite, name, "pass", detail) |
| 62 | |
| 63 | def fail(self, name, reason): |
| 64 | self.failed += 1 |
| 65 | self.errors.append((name, reason)) |
| 66 | print(f" FAIL {name}: {reason}") |
| 67 | self.rc.report(self.current_suite, name, "fail", reason) |
| 68 | |
| 69 | |
| 70 | def wait_for_duckgres(): |