Skip to content
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

remove warning filter in pytest plugin #1757

Merged
merged 2 commits into from Feb 22, 2024

Conversation

braingram
Copy link
Contributor

@braingram braingram commented Feb 14, 2024

Description

This PR removes the warnings filter in the asdf pytest plugin that was converting (most) warnings to errors:

asdf/pytest_asdf/plugin.py

Lines 242 to 245 in fcff366

# Do not tolerate any warnings that occur during schema validation
with warnings.catch_warnings():
warnings.simplefilter("error")
warnings.simplefilter("default", category=AsdfDeprecationWarning)

This filter is preventing all other warning filtering from having any effect. This is currently making it difficult to make the downstream weldx job pass as pandas is triggering a warning during several of the schema tests. Ideally we could ignore this warning (as it's a deprecation warning that weldx will need to address) by adding a filter to the weldx tox environment. However this is not possible because of the above warnings filter. Instead we would have to add the pandas warning to the pytest plugin warnings filter. With this PR we can add the warning filter to the tox.ini and it will have an effect.

As this PR removes the warnings filter internal to the asdf pytest plugin this does mean that any library that relied on this to turn warnings into errors during schema tests will need to add their own warnings filter (if they don't already have one).

Checklist:

  • pre-commit checks ran successfully
  • tests ran successfully
  • for a public change, a changelog entry was added
  • for a public change, documentation was updated
  • for any new features, unit tests were added

@braingram braingram marked this pull request as ready for review February 14, 2024 17:11
@braingram braingram requested a review from a team as a code owner February 14, 2024 17:11
Copy link
Member

@zacharyburnett zacharyburnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, especially as it affects downstream

@braingram
Copy link
Contributor Author

Thanks for the review!

@braingram braingram merged commit 698bd30 into asdf-format:main Feb 22, 2024
34 checks passed
@braingram braingram deleted the unfilter_warnings branch February 22, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants