Improve filtering of warnings in pytest#411
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves pytest warning filtering by replacing command-line -W options with a dedicated filterwarnings configuration across multiple pyproject.toml files and updates the migration script accordingly.
- Consolidates warning filters to use regular expressions for dynamic protobuf version warnings
- Updates cookiecutter templates and a migration utility to support filterwarnings
- Adjusts RELEASE_NOTES to document the change
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml | Updated warning options to use filterwarnings |
| tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml | Updated warning options to use filterwarnings |
| tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml | Updated warning options to use filterwarnings |
| tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml | Updated warning options to use filterwarnings |
| tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml | Updated warning options to use filterwarnings |
| pyproject.toml | Updated warning options to use filterwarnings |
| cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml | Updated warning options to use filterwarnings |
| cookiecutter/migrate.py | Added migration logic for converting -W flags to filterwarnings |
| RELEASE_NOTES.md | Updated release notes to mention new warning ignore changes |
e85a9cd to
ee270d7
Compare
|
Thanks @flora-hofmann-frequenz, it looks you don't have power to approve so I still need another approval from @frequenz-floss/python-sdk-team. |
Looks like I don't, sorry :-( |
daniel-zullo-frequenz
left a comment
There was a problem hiding this comment.
I have a few optional comments to check for, LGTM otherwise
|
I remove it from the merging queue in case you'd like to address any of the comments |
|
nitpick: there is also a typo in the commit message |
|
Updated. |
This updates the cookiecutter templates to ignore warnings by using the separate `filterwarnings` options instead of using command-line options. This allows using regex, which is needed to add a new ignore for protobuf gencode version warnings, that includes the protobuf version, which will change dynamically. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Fixed too. |
This updates the cookiecutter templates to ignore warnings by using the separate
filterwarningsoptions instead of using command-line options.This allows using regex, which is needed to add a new ignore for protobuf gencode version warnings, that includes the protobuf version, which will change dynamically.