summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-06-19 11:21:59 +0200
committerMichał Górny <mgorny@gentoo.org>2021-07-02 10:25:40 +0200
commit7ae1b4b192f9885370f9e64f55f25ce64d542a88 (patch)
treec4d9bf525ec6dd92f286a7277a62be2b0581915c
parentsci-libs/libsigrok: min java 1.8:* (diff)
downloadgentoo-7ae1b4b1.tar.gz
gentoo-7ae1b4b1.tar.bz2
gentoo-7ae1b4b1.zip
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>
-rw-r--r--eclass/python-utils-r1.eclass3
1 files changed, 3 insertions, 0 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 7488802332f6..168c767a2eea 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[@]}" "${@}"