diff --git a/tests/unit/test_positioning_cap_coverage_audit.py b/tests/unit/test_positioning_cap_coverage_audit.py index 246131c..21a9127 100644 --- a/tests/unit/test_positioning_cap_coverage_audit.py +++ b/tests/unit/test_positioning_cap_coverage_audit.py @@ -31,10 +31,15 @@ def _func_body(text: str, fn: str) -> str: def test_every_live_positioning_callsite_threads_the_cap(): + # Require the param to appear as a FORWARDED keyword arg (`positioning_coin_gross_cap=` or the seam's + # `coin_gross_cap=` in bybit_testnet_run's direct-seam calls), not merely SOMEWHERE in the body. A bare + # substring check would pass a partial regression where the param survives in the signature/docstring but + # is dropped from the inner seam call — exactly the silent break this guard exists to catch. + _forwarded = re.compile(r"(?:positioning_)?coin_gross_cap\s*=") missing = [] for rel, fn in _LIVE_CALLSITES: body = _func_body((_ROOT / rel).read_text(), fn) - if "positioning_coin_gross_cap" not in body: + if not _forwarded.search(body): missing.append(f"{rel}::{fn}") - assert not missing, ("LIVE positioning path(s) missing positioning_coin_gross_cap (opt-in, fail-safe): " - + ", ".join(missing)) + assert not missing, ("LIVE positioning path(s) not FORWARDING positioning_coin_gross_cap (opt-in, " + "fail-safe): " + ", ".join(missing))