Skip to content

Commit

Permalink
turn warnings into errors on pyargs runs
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Feb 27, 2024
1 parent d954b1e commit 50d4b67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions asdf/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
collect_ignore = ["asdf.py", "stream.py"]


def pytest_collection_modifyitems(items):
# Turn warnings into errors for all tests, this is needed
# as running tests through pyargs will not use settings
# defined in pyproject.toml
for item in items:
item.add_marker(pytest.mark.filterwarnings("error"), False)


@pytest.fixture(scope="session", autouse=True)
def _temp_cwd(tmp_path_factory):
"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ norecursedirs = ['build', 'docs/_build', 'docs/sphinxext']
doctest_plus = 'enabled'
remote_data_strict = true
filterwarnings = [
'error',
'error', # also set in _tests/conftest to work with pyargs
'ignore:numpy.ndarray size changed:RuntimeWarning',
]
# Configuration for pytest-doctestplus
Expand Down

0 comments on commit 50d4b67

Please sign in to comment.