Skip to content

Commit ea381c8

Browse files
igerberclaude
andcommitted
Address PR #345 CI review P3s: refresh stale comment + add removal regression guard
- tests/test_rust_backend.py: updated the stale "tracked as a low-priority Rust cleanup TODO" comment to reflect that the Rust-side removal is now done alongside the Python-side removal. - tests/test_rust_backend.py: new test_compute_synthetic_weights_is_removed as a regression guard against accidental re-export of the deleted PyO3 binding. Asserts both `from diff_diff._rust_backend import compute_synthetic_weights` raises ImportError and the attribute is absent on the module object. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3c89a4c commit ea381c8

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

tests/test_rust_backend.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,26 @@ def test_bootstrap_different_seeds(self):
106106

107107
# Tests for `compute_synthetic_weights` direct Rust binding removed in
108108
# the silent-failures audit post-cleanup (finding #22). The helper was
109-
# deleted from the Python layer; remaining Rust symbol is dead code
110-
# (tracked as a low-priority Rust cleanup TODO).
109+
# deleted from the Python layer and the Rust symbol was subsequently
110+
# removed from `rust/src/weights.rs` + unregistered in `rust/src/lib.rs`.
111+
112+
def test_compute_synthetic_weights_is_removed(self):
113+
"""Regression guard against accidental re-export of the deleted
114+
`compute_synthetic_weights` PyO3 binding (silent-failures finding
115+
#22). If this test fails, someone reintroduced the binding — audit
116+
the reason before adding it back."""
117+
import diff_diff._rust_backend as rb
118+
119+
with pytest.raises(ImportError):
120+
from diff_diff._rust_backend import ( # noqa: F401
121+
compute_synthetic_weights,
122+
)
123+
124+
assert not hasattr(rb, "compute_synthetic_weights"), (
125+
"compute_synthetic_weights was removed from the Rust backend "
126+
"in the post-audit cleanup for finding #22; its presence here "
127+
"indicates accidental re-export."
128+
)
111129

112130
# =========================================================================
113131
# Simplex Projection Tests

0 commit comments

Comments
 (0)