integration: add tests/test_proofs.py
Browse files- tests/test_proofs.py +29 -0
tests/test_proofs.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Theory proofing suite tests — every proof must pass."""
|
| 2 |
+
|
| 3 |
+
import sys
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
|
| 6 |
+
import pytest
|
| 7 |
+
|
| 8 |
+
ROOT = Path(__file__).resolve().parent.parent
|
| 9 |
+
sys.path.insert(0, str(ROOT))
|
| 10 |
+
sys.path.insert(0, str(ROOT / "proofs"))
|
| 11 |
+
|
| 12 |
+
import theory_proofs as tp # noqa: E402
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
@pytest.mark.parametrize("fn", [
|
| 16 |
+
tp.p1, tp.p2, tp.p3, tp.p4, tp.p5, tp.p6, tp.p7,
|
| 17 |
+
])
|
| 18 |
+
def test_proof(fn):
|
| 19 |
+
"""Each proof must evaluate to True (see proofs/theory_proofs.py)."""
|
| 20 |
+
assert fn() is True, f"proof failed: {fn.__name__}"
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def test_all_proofs_defined():
|
| 24 |
+
names = {r["proof"] for r in tp.RESULTS}
|
| 25 |
+
assert names == {
|
| 26 |
+
"P1 IPT gradient", "P2 Phi-5 Kronecker", "P3 Progression honesty",
|
| 27 |
+
"P4 CHSH Bell", "P5 HOLO-MEM Φ-symmetry", "P6 Kyrexis anchors",
|
| 28 |
+
"P7 Coral invariants",
|
| 29 |
+
}
|