-
Notifications
You must be signed in to change notification settings - Fork 8
Improve filtering of warnings in pytest #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
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 :-( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
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.