(repo: Path, *, baseline: dict[str, str], tip: dict[str, str])
| 59 | |
| 60 | |
| 61 | def reported_names(repo: Path, *, baseline: dict[str, str], tip: dict[str, str]) -> list[str]: |
| 62 | (repo / "scripts").mkdir() |
| 63 | shutil.copy(SCRIPT, repo / "scripts") |
| 64 | write_package(repo, baseline) |
| 65 | git(repo, "init") |
| 66 | git(repo, "add", ".") |
| 67 | git(repo, "commit", "-m", "baseline") |
| 68 | write_package(repo, tip) |
| 69 | |
| 70 | result = subprocess.run( |
| 71 | [sys.executable, "scripts/detect-breaking-changes.py", "HEAD"], |
| 72 | cwd=repo, |
| 73 | env=subprocess_env(), |
| 74 | capture_output=True, |
| 75 | text=True, |
| 76 | ) |
| 77 | |
| 78 | lines = [line for line in result.stdout.splitlines() if line.startswith("(")] |
| 79 | assert result.returncode == (1 if lines else 0), result.stdout + result.stderr |
| 80 | return sorted(line.split()[-1].removeprefix(f"{PACKAGE}.") for line in lines) |
| 81 | |
| 82 | |
| 83 | @pytest.mark.parametrize( |
no test coverage detected