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

ENH: Consider warnings as errors when running pytest #157

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,19 @@ addopts = [
"--cov=nireports",
"--cov-report=xml",
"--cov-config=pyproject.toml",
# Warnings filters apply most recent first
# Note that when adding modules
# Default: Error on warnings
"-Werror",
# traits 6.4.3 still uses sre_parse
"-Wignore::DeprecationWarning:traits.observation._generated_parser",
# svgutils.compose regular expressions have unescaped backslashes
"-Wignore::SyntaxWarning:svgutils.compose",
# PendingDeprecations will produce too many false positives
# Frequently impossible to address without breaking compatibility with
# older versions of the dependency, e.g., seaborn which needs to support
# a wide range of matplotlib versions
"-Wonce::PendingDeprecationWarning",
]
doctest_optionflags = "ALLOW_UNICODE NORMALIZE_WHITESPACE ELLIPSIS"
env = "PYTHONHASHSEED=0"
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ uv_resolution =
min: lowest-direct

commands =
pytest --durations=20 --durations-min=1.0 --cov-report term-missing {posargs:-n auto}
pytest --durations=20 --durations-min=1.0 --cov-report term-missing \
min,pre: -Wignore \
Copy link
Member

Choose a reason for hiding this comment

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

This warning setting takes precedence over those in tool.pytest.ini_options. For min, we expect a lot of warnings that the older versions of the libraries we're testing of course cannot resolve. For pre, we expect many PendingDeprecationWarnings and DeprecationWarnings before our upstreams even have time to address.

{posargs:-n auto}

[testenv:style]
description = Check our style guide
Expand Down
Loading