| 73 | |
| 74 | |
| 75 | def read_suites(path: pathlib.Path) -> list[str]: |
| 76 | try: |
| 77 | suites = path.read_text(encoding="utf-8").splitlines() |
| 78 | except OSError as exc: |
| 79 | raise RuntimeError(f"cannot read suite file {path}: {exc}") from exc |
| 80 | malformed = [suite for suite in suites if SUITE_NAME.fullmatch(suite) is None] |
| 81 | if malformed: |
| 82 | raise RuntimeError(f"malformed suite name in {path}: {malformed[0]!r}") |
| 83 | if len(set(suites)) != len(suites): |
| 84 | raise RuntimeError(f"duplicate suite name in {path}") |
| 85 | return suites |
| 86 | |
| 87 | |
| 88 | def append_log(path: pathlib.Path, message: str) -> None: |