Commit 87538d2
test: Suppress experimental feature warnings in unit tests
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: 9308249311 parent 6262f94 commit 87538d2
2 files changed
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
311 | 314 | | |
312 | 315 | | |
313 | 316 | | |
| |||
323 | 326 | | |
324 | 327 | | |
325 | 328 | | |
326 | | - | |
| 329 | + | |
327 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
328 | 334 | | |
329 | 335 | | |
330 | 336 | | |
| |||
340 | 346 | | |
341 | 347 | | |
342 | 348 | | |
343 | | - | |
| 349 | + | |
344 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
345 | 354 | | |
346 | 355 | | |
347 | 356 | | |
| |||
356 | 365 | | |
357 | 366 | | |
358 | 367 | | |
359 | | - | |
| 368 | + | |
360 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
361 | 373 | | |
362 | 374 | | |
363 | 375 | | |
| |||
0 commit comments