From 5a45007e45ef2030bd169ad581bb05b8356d81cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Wed, 8 Jan 2025 20:25:25 -0500 Subject: [PATCH 1/3] ENH: Consider warnings as errors when running `pytest` Consider warnings as errors when running `pytest`: exclude the `min` dependencies configuration as warnings are expected with older versions. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 2cfbeae1..819e84af 100644 --- a/tox.ini +++ b/tox.ini @@ -67,7 +67,7 @@ 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: -Werror {posargs:-n auto} [testenv:style] description = Check our style guide From c51dc3a4af7317fa6a65fd0771cfa35ac4bebca6 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 9 Jan 2025 19:39:27 -0500 Subject: [PATCH 2/3] Update tox.ini --- tox.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 819e84af..c8931fd6 100644 --- a/tox.ini +++ b/tox.ini @@ -67,7 +67,9 @@ uv_resolution = min: lowest-direct commands = - pytest --durations=20 --durations-min=1.0 --cov-report term-missing !min: -Werror {posargs:-n auto} + pytest --durations=20 --durations-min=1.0 --cov-report term-missing \ + !min: -Werror \ + {posargs:-n auto} [testenv:style] description = Check our style guide From d3cfa4acd3576de9a45b2bbe14e711803ff96f32 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Mon, 13 Jan 2025 10:43:09 -0500 Subject: [PATCH 3/3] chore(test): Set reasonable warnings configuration --- pyproject.toml | 13 +++++++++++++ tox.ini | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c67379a9..93a26f8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/tox.ini b/tox.ini index c8931fd6..f6b2ce2d 100644 --- a/tox.ini +++ b/tox.ini @@ -68,7 +68,7 @@ uv_resolution = commands = pytest --durations=20 --durations-min=1.0 --cov-report term-missing \ - !min: -Werror \ + min,pre: -Wignore \ {posargs:-n auto} [testenv:style]