commit:     7ae1b4b192f9885370f9e64f55f25ce64d542a88
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 19 09:21:59 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul  2 08:25:40 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ae1b4b1

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 <AT> 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 7488802332f..168c767a2ee 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1264,6 +1264,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[@]}" "${@}"
 

Reply via email to