Skip to content

Commit

Permalink
add filter for ValidationWarning (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram authored Nov 25, 2024
1 parent 4ea7d91 commit b36314f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/367.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Modify warning filters to re-show identical ValidationWarnings on re-validation.
5 changes: 5 additions & 0 deletions src/stdatamodels/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class ValidationWarning(Warning):
pass


# always show validation warnings unless another filter was added that
# matches these warnings (by passing append=True)
warnings.filterwarnings("always", category=ValidationWarning, append=True)


def value_change(path, value, schema, ctx):
"""
Validate a change in value against a schema.
Expand Down

0 comments on commit b36314f

Please sign in to comment.