| 132 | |
| 133 | |
| 134 | def read_suites(path: pathlib.Path) -> list[str]: |
| 135 | try: |
| 136 | suites = path.read_text(encoding="utf-8").splitlines() |
| 137 | except OSError as exc: |
| 138 | raise RuntimeError(f"cannot read suite file {path}: {exc}") from exc |
| 139 | malformed = [suite for suite in suites if SUITE_NAME.fullmatch(suite) is None] |
| 140 | if malformed: |
| 141 | raise RuntimeError(f"malformed suite name in {path}: {malformed[0]!r}") |
| 142 | if len(set(suites)) != len(suites): |
| 143 | raise RuntimeError(f"duplicate suite name in {path}") |
| 144 | return suites |
| 145 | |
| 146 | |
| 147 | def append_log(path: pathlib.Path, message: str) -> None: |