summaryrefslogtreecommitdiffstats
path: root/awxkit
diff options
context:
space:
mode:
authorSviatoslav Sydorenko <wk@sydorenko.org.ua>2024-11-07 13:19:08 +0100
committerAlan Rominger <arominge@redhat.com>2024-11-25 20:01:21 +0100
commitd8e87da898590e174f8fc0d70d2cb32f29d0c546 (patch)
tree5c5626a8e2eeae88caa88f63fdb0d114afbf1744 /awxkit
parentAdd descriptions for plugin names (#15643) (diff)
downloadawx-d8e87da898590e174f8fc0d70d2cb32f29d0c546.tar.xz
awx-d8e87da898590e174f8fc0d70d2cb32f29d0c546.zip
🧪 Make pytest notify us about future warnings
In essence, this configures Python to turn any warnings emitted in runtime into errors[[1]]. This is the best practice that allows reacting to future deprecation announcements that are coming from the dependencies (direct, or transitive, or even CPython itself)[[2]]. The typical workflow looks like this: 1. If a dependency is updated an a warning is hit in tests, the deprecated thing should be replaced with newer APIs. 2. If a dependency is transitive or we have no control over it otherwise, the specific warning and a regex matching its message, plus the module reference (where possible) can be added to the list of temporary ignores in `pytest.ini`. 3. The list of temporary ignores should be reevaluated periodically, including when dependency re-pinning in lockfile is happening. [1]: https://docs.python.org/3/using/cmdline.html#cmdoption-W [2]: https://pytest-with-eric.com/configuration/pytest-ignore-warnings/
Diffstat (limited to 'awxkit')
-rw-r--r--awxkit/test/pytest.ini0
-rw-r--r--awxkit/tox.ini4
2 files changed, 4 insertions, 0 deletions
diff --git a/awxkit/test/pytest.ini b/awxkit/test/pytest.ini
deleted file mode 100644
index e69de29bb2..0000000000
--- a/awxkit/test/pytest.ini
+++ /dev/null
diff --git a/awxkit/tox.ini b/awxkit/tox.ini
index 132f72099b..97e7949dc9 100644
--- a/awxkit/tox.ini
+++ b/awxkit/tox.ini
@@ -44,4 +44,8 @@ max-line-length = 120
[pytest]
addopts = -v --tb=native
+
+filterwarnings =
+ error
+
junit_family=xunit2