test: Suppress experimental feature warnings in unit tests#6087
Closed
Jacksunwei wants to merge 1 commit into
Closed
test: Suppress experimental feature warnings in unit tests#6087Jacksunwei wants to merge 1 commit into
Jacksunwei wants to merge 1 commit into
Conversation
Unit tests instantiate many @experimental-decorated classes, flooding test output with [EXPERIMENTAL] UserWarning messages. Set ADK_SUPPRESS_EXPERIMENTAL_FEATURE_WARNINGS=true in the unittests conftest to silence them session-wide. The four *_no_parens / *_empty_parens decorator tests that assert the warning fires now delenv the suppress var first, matching the pattern already used by their sibling tests, so they remain valid under the new default. Change-Id: I589079da589eba76f799413e19287fd264986dd6
copybara-service Bot
pushed a commit
that referenced
this pull request
Jun 12, 2026
Merge #6087 ## Summary - Unit tests instantiate many `@experimental`-decorated classes, flooding test output with `[EXPERIMENTAL]` `UserWarning` messages. - Set `ADK_SUPPRESS_EXPERIMENTAL_FEATURE_WARNINGS=true` in `tests/unittests/conftest.py` (alongside the existing `ADK_ALLOW_WIP_FEATURES`) to silence them session-wide. - The four `*_no_parens` / `*_empty_parens` decorator tests that assert the warning fires now `monkeypatch.delenv` the suppress var first, matching the pattern already used by their sibling tests, so they remain valid under the new default. ## Test plan - [x] `uv run pytest tests/unittests/utils/test_feature_decorator.py tests/unittests/features/test_feature_decorator.py` passes - [x] Verified a real `@experimental` class (`InMemoryCredentialService`) emits 0 `[EXPERIMENTAL]` warnings with the var set, 2 without Co-authored-by: Wei Sun (Jack) <weisun@google.com> COPYBARA_INTEGRATE_REVIEW=#6087 from google:test/suppress-experimental-warnings 23c43d9 PiperOrigin-RevId: 930824931
Collaborator
|
Thank you @Jacksunwei for your contribution! 🎉 Your changes have been successfully imported and merged via Copybara in commit 87538d2. Closing this PR as the changes are now in the main branch. |
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
@experimental-decorated classes, flooding test output with[EXPERIMENTAL]UserWarningmessages.ADK_SUPPRESS_EXPERIMENTAL_FEATURE_WARNINGS=trueintests/unittests/conftest.py(alongside the existingADK_ALLOW_WIP_FEATURES) to silence them session-wide.*_no_parens/*_empty_parensdecorator tests that assert the warning fires nowmonkeypatch.delenvthe suppress var first, matching the pattern already used by their sibling tests, so they remain valid under the new default.Test plan
uv run pytest tests/unittests/utils/test_feature_decorator.py tests/unittests/features/test_feature_decorator.pypasses@experimentalclass (InMemoryCredentialService) emits 0[EXPERIMENTAL]warnings with the var set, 2 without