fix: scope the citation guard to profile_sync

The guard globbed every profiling module, so moving the MAME ref audit
into profiling failed it. It now reads the modules profile_sync runs.
This commit is contained in:
Abdessamad Derraz committed 2026-11-21 15:47:20 +01:00
1 parent f8c317b63f
commit cff440613d
1 file changed
+4 -5
+4 -5
View File
@@ -19,6 +19,7 @@ from unittest import mock
import yaml
import profile_sync
from tests.sources import script_source
from profiling import anchoring
from profiling import bump
from profiling import citations as profiling_citations
@@ -4295,12 +4296,10 @@ class TestCitationSurfaceGuard(unittest.TestCase):
A consumer keying on the field name reopens the gap this closes:
citations outside its list rot while the pin advances. The walker
matches the key once. Everything else goes through the collector.
The audits beside it in profiling (mamerefs reads MAME driver refs)
advance no pin and are not read here.
"""
cli = Path(profile_sync.__file__)
source = "".join(
path.read_text(encoding="utf-8")
for path in [cli, *sorted((cli.parent / "profiling").glob("*.py"))]
)
source = script_source("profile_sync.py")
self.assertNotIn('.get("source_ref")', source)
self.assertEqual(source.count('== "source_ref"'), 1)