Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/package_contract/test_agent_handoff_1_12.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ def test_agent_handoff_1_12__launcher_and_projection__preserve_package_bytes() -

def test_agent_handoff_1_12__mutable_navigation__names_the_new_authority() -> None:
expected_links = {
_FAMILY / "README.md": "versions/1.16/README.md",
_FAMILY / "adopt.md": "versions/1.16/adopt.md",
_FAMILY / "agent-summary.md": "versions/1.16/agent-summary.md",
_FAMILY / "README.md": "versions/1.17/README.md",
_FAMILY / "adopt.md": "versions/1.17/adopt.md",
_FAMILY / "agent-summary.md": "versions/1.17/agent-summary.md",
}
for path, expected_link in expected_links.items():
content = path.read_text(encoding="utf-8")
Expand Down
2 changes: 1 addition & 1 deletion tests/package_contract/test_agent_handoff_1_15.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_agent_handoff_1_15__identity__is_complete_and_current() -> None:
}
assert roles["1.14"] == "retained"
assert roles["1.15"] == "retained"
assert "| [`agent-handoff`](agent-handoff/README.md) | active | 1.16 | default |" in (
assert "| [`agent-handoff`](agent-handoff/README.md) | active | 1.17 | default |" in (
_ROOT / "standards/catalog.md"
).read_text(encoding="utf-8")

Expand Down
7 changes: 2 additions & 5 deletions tests/package_contract/test_cut_successor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from __future__ import annotations

import importlib.util
import shutil
import tomllib
from pathlib import Path
Expand All @@ -21,6 +20,7 @@
from project_standards.cli import main
from project_standards.package_contract.cut_successor import apply_cut, plan_cut
from project_standards.package_contract.diagnostics import PackageContractError
from tests.module_loading import load_module_from_path

_ROOT = Path(__file__).resolve().parents[2]
# python-coding is the smallest family in the repository (four payload files) and
Expand Down Expand Up @@ -54,10 +54,7 @@ def _next_version(repository: Path, standard_id: str) -> tuple[str, str]:

def _run_module(path: Path) -> None:
"""Import one generated test module and run every test function it defines."""
spec = importlib.util.spec_from_file_location(path.stem, path)
assert spec is not None and spec.loader is not None
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
module = load_module_from_path(path.stem, path)
cases = [name for name in dir(module) if name.startswith("test_")]
assert cases, f"scaffolded module defines no test: {path}"
for name in cases:
Expand Down
19 changes: 18 additions & 1 deletion tests/package_contract/test_github_workflow_1_9.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,14 @@ def _run_binary(args: Sequence[str], cwd: Path) -> subprocess.CompletedProcess[s
)


# The corpus this assertion measures is frozen at the last commit before the
# `Workflow-Admission` classes started landing on `testing` (the v5.28.0 D4 adoption
# commit). `HEAD` would drift: every legitimate `T0` or `handoff` commit admitted after
# the floor would flip the zero counts below, turning a fixed-epoch measurement into a
# prohibition on classes CLAUDE.md declares valid.
_CORPUS_TIP = "4866a9fa"


@_requires_binary
def test_github_workflow_1_9__classifier__flags_this_repository_own_history() -> None:
"""The non-vacuity proof #203 requires, run over the corpus that motivated it.
Expand All @@ -571,7 +579,16 @@ def test_github_workflow_1_9__classifier__flags_this_repository_own_history() ->
network reachability.
"""
result = _run_binary(
["admission", "--branch", "HEAD", "--since", "9c47907f", "--offline", "--output", "json"],
[
"admission",
"--branch",
_CORPUS_TIP,
"--since",
"9c47907f",
"--offline",
"--output",
"json",
],
cwd=_ROOT,
)
if result.returncode == 2 and "reading commits" in result.stdout + result.stderr:
Expand Down
1 change: 1 addition & 0 deletions tests/test_repository_hygiene.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"scripts/build-command-provider-fixture.sh",
"scripts/build-gh-workflow.sh",
"scripts/githooks/main-branch-guard",
"scripts/go-verify-stamp.sh",
"scripts/install-githooks.sh",
"scripts/wheel-runtime-stamp.sh",
}
Expand Down
4 changes: 3 additions & 1 deletion tests/test_spec_selected_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,10 @@ def test_selected_validate_uses_captured_bytes_if_path_changes_after_snapshot(
def capture_then_swap(
repo_root: Path,
targets: tuple[SafeRelativePath, ...],
*,
retain_content: bool = True,
) -> RepositorySnapshot:
result = real_capture(repo_root, targets)
result = real_capture(repo_root, targets, retain_content=retain_content)
if any(target.original == "victim.md" for target in targets):
victim.unlink()
victim.symlink_to(outside)
Expand Down
Loading