(path: str | Path)
| 173 | |
| 174 | |
| 175 | def read_fixture_file(path: str | Path) -> list[list[Any]]: |
| 176 | text = Path(path).read_text(encoding="utf-8") |
| 177 | tests = [] |
| 178 | section = 0 |
| 179 | last_pos = 0 |
| 180 | lines = text.splitlines(keepends=True) |
| 181 | for i in range(len(lines)): |
| 182 | if lines[i].rstrip() == ".": |
| 183 | if section == 0: |
| 184 | tests.append([i, lines[i - 1].strip()]) |
| 185 | section = 1 |
| 186 | elif section == 1: |
| 187 | tests[-1].append("".join(lines[last_pos + 1 : i])) |
| 188 | section = 2 |
| 189 | elif section == 2: |
| 190 | tests[-1].append("".join(lines[last_pos + 1 : i])) |
| 191 | section = 0 |
| 192 | |
| 193 | last_pos = i |
| 194 | return tests |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…