test(presets): silence expected UserWarnings in self-test composition…#2373
Open
Quratulain-bilal wants to merge 1 commit intogithub:mainfrom
Open
test(presets): silence expected UserWarnings in self-test composition…#2373Quratulain-bilal wants to merge 1 commit intogithub:mainfrom
Quratulain-bilal wants to merge 1 commit intogithub:mainfrom
Conversation
… tests
The self-test preset that ships with the repo provides a wrap-strategy
command (speckit.wrap-test) intentionally without a corresponding core
base layer, exercising the 'no base layer' branch of
_reconcile_composed_commands().
Eighteen tests across TestSelfTestPreset and TestPresetSkills install
this preset and trigger an expected UserWarning. Running the suite with
-W error::UserWarning surfaces them as test noise that could obscure
unrelated warnings.
Add class-level pytest.mark.filterwarnings filters to acknowledge the
two known messages ('Cannot compose command speckit.wrap-test' and
'Post-install reconciliation failed for self-test') so other UserWarning
sources still propagate normally.
Fixes github#2363
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2363 —
tests/test_presets.pyproduces 18 unhandledUserWarnings when the self-test preset is installed duringtests.
Root cause
The repo's
presets/self-test/preset providesspeckit.wrap-test, a wrap-strategy command intentionally without abase layer to exercise that code path.
_reconcile_composed_commands()inpresets.py:786deliberately emitsUserWarning("Cannot compose command 'speckit.wrap-test': no base layer...")and a follow-up"Post-install reconciliation failed..."warning — these are expected for this fixture but were not acknowledged at the test level.Fix
Per the issue's option #2, add
@pytest.mark.filterwarnings(...)decorators onTestSelfTestPresetandTestPresetSkillsfor the two known messages. OtherUserWarningsources still propagate normally so futureregressions remain visible.
Verification