[PATCH] python-utils-r1.eclass: epytest, clear filterwarnings= entirely

Michał Górny <[email protected]> Tue, 14 Jul 2026 13:16:16 +0200
Newsgroups gmane.linux.gentoo.devel
Message-ID <[email protected]>
Rather than overriding the 'filterwarnings' option via forcing
'-Wdefault', clear it entirely.  This solves the original problem of
upstream forcing 'error', as well as avoids unnecessary 'ImportError's
when upstream is combining said 'error' with a bunch of 'ignore' entries
for optional dependencies.

Signed-off-by: Michał Górny <[email protected]>
---
 eclass/python-utils-r1.eclass | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 023d951d54dc2..7c3b3d985f2aa 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1445,9 +1445,11 @@ 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
+		# override filterwarnings=:
+		# 1. we do not really want -Werror for end users, as it tends
+		#    to fail on new warnings from deps
+		# 2. ignore: lines for optional dependencies trigger ImportError
+		-o filterwarnings=
 		# override color output
 		"--color=${color}"
 		# count is more precise when we're dealing with a large number