Bug Report
Description
In src/assets/tests/functional/test_system_admin.py line 9228, an imperative pytest.xfail() call is used instead of the @pytest.mark.xfail(strict=True, ...) decorator.
The imperative form does not support strict=True, which means if the gap is closed (the test would pass), it silently continues reporting as xfail rather than failing as XPASS. This defeats the spec-gap audit cycle described in CLAUDE.md.
Current code
if "anthropic" not in content:
pytest.xfail(
"GAP: AI privacy disclosure not rendered "
"in template (US-SA-143, S2.14.6-03)"
)
Expected
Use the decorator form with strict=True so that XPASS is detected:
@pytest.mark.xfail(strict=True, reason="GAP: AI privacy disclosure not rendered in template (US-SA-143, S2.14.6-03)")
Note: the imperative form is used here because the xfail is conditional (only triggers when "anthropic" not in content). A refactor may be needed to make the condition work with the decorator — e.g. using pytest.mark.xfail with a condition parameter, or restructuring the test.
Spec Consideration
This is a testing infrastructure fix to comply with the existing CLAUDE.md functional test rules. No spec changes required.
Found during code review of PR #55.
Bug Report
Description
In
src/assets/tests/functional/test_system_admin.pyline 9228, an imperativepytest.xfail()call is used instead of the@pytest.mark.xfail(strict=True, ...)decorator.The imperative form does not support
strict=True, which means if the gap is closed (the test would pass), it silently continues reporting as xfail rather than failing as XPASS. This defeats the spec-gap audit cycle described in CLAUDE.md.Current code
Expected
Use the decorator form with
strict=Trueso that XPASS is detected:@pytest.mark.xfail(strict=True, reason="GAP: AI privacy disclosure not rendered in template (US-SA-143, S2.14.6-03)")Note: the imperative form is used here because the xfail is conditional (only triggers when "anthropic" not in content). A refactor may be needed to make the condition work with the decorator — e.g. using
pytest.mark.xfailwith aconditionparameter, or restructuring the test.Spec Consideration
This is a testing infrastructure fix to comply with the existing CLAUDE.md functional test rules. No spec changes required.
Found during code review of PR #55.