Mailing List Archive

[PATCH] python-utils-r1.eclass: Pass -Wdefault to epytest to avoid -Werror
Make pytest pass -Wdefault in order to override upstream default warning
options that commonly include -Werror. This has often caused tests to
start failing due to new deprecation warnings introduced
in dependencies, or block new implementations due to harmless
deprecation warnings.

A side effect of this is that we are overriding all warning options used
by upstream. This could e.g. cause more warnings to be reported (when
upstream ignores some of them). This might also break badly written
tests (e.g. when they rely on exceptions to catch warnings).

Signed-off-by: Micha? Górny <mgorny@gentoo.org>
---
eclass/python-utils-r1.eclass | 3 +++
1 file changed, 3 insertions(+)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 3dbf221eac5d..2766db4d9da6 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1284,6 +1284,9 @@ epytest() {
-ra
# print local variables in tracebacks, useful for debugging
-l
+ # override filterwarnings=error, we do not really want -Werror
+ # for end users, as it tends to fail on new warnings from deps
+ -Wdefault
)
set -- "${EPYTHON}" -m pytest "${args[@]}" "${@}"

--
2.32.0