Skip to content

Commit

Permalink
Merge pull request #1757 from braingram/unfilter_warnings
Browse files Browse the repository at this point in the history
remove warning filter in pytest plugin
  • Loading branch information
braingram authored Feb 22, 2024
2 parents 841c046 + 19ee471 commit 698bd30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ The ASDF Standard is at v1.6.0
- Eliminate the use of the legacy ``tmpdir`` fixture in favor of
the new ``tmp_path`` fixture for temporary directory creation. [#1759]

- Remove conversion of warnings to errors in asdf pytest plugin. This
prevented other warning filters (like those provided with ``-W``)
from working. If you want these warnings to produce errors you can
now add your own warning filter [#1757]

3.0.1 (2023-10-30)
------------------

Expand Down
9 changes: 1 addition & 8 deletions pytest_asdf/plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import io
import os
import pathlib
import warnings
from dataclasses import dataclass

import numpy as np
Expand Down Expand Up @@ -213,7 +212,6 @@ def from_parent(
def runtest(self):
from asdf import AsdfFile, _block, generic_io, util
from asdf._tests import _helpers as helpers
from asdf.exceptions import AsdfDeprecationWarning

# Make sure that the examples in the schema files (and thus the
# ASDF standard document) are valid.
Expand All @@ -239,12 +237,7 @@ def runtest(self):
f.seek(0)

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

ff._open_impl(ff, buff, mode="rw")
ff._open_impl(ff, buff, mode="rw")
except Exception:
print(f"Example: {self.example.description}\n From file: {self.filename}")
raise
Expand Down

0 comments on commit 698bd30

Please sign in to comment.