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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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