commit:     32a5972280c1c9fbf8dd5af014df541fe110f0e6
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri May 23 16:39:30 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri May 23 16:52:27 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32a59722

dev-python/selenium: Add test deps only for PYTHON_TESTED impls

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/selenium/selenium-4.32.0.ebuild | 34 +++++++++++++++++-------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/dev-python/selenium/selenium-4.32.0.ebuild 
b/dev-python/selenium/selenium-4.32.0.ebuild
index f630c84eed56..e0b4478aac9c 100644
--- a/dev-python/selenium/selenium-4.32.0.ebuild
+++ b/dev-python/selenium/selenium-4.32.0.ebuild
@@ -30,7 +30,8 @@ SRC_URI+="
 LICENSE="Apache-2.0"
 SLOT="0"
 KEYWORDS="amd64 ~arm arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
-IUSE="test-rust"
+IUSE="test test-rust"
+RESTRICT="!test? ( test )"
 
 RDEPEND="
        >=dev-python/certifi-2021.10.8[${PYTHON_USEDEP}]
@@ -47,24 +48,25 @@ RDEPEND="
 "
 BDEPEND="
        test? (
-               dev-python/filetype[${PYTHON_USEDEP}]
-               dev-python/pytest-mock[${PYTHON_USEDEP}]
-               test-rust? (
-                       dev-python/pytest-rerunfailures[${PYTHON_USEDEP}]
-                       dev-python/pytest-xdist[${PYTHON_USEDEP}]
-                       dev-util/selenium-manager
-                       net-misc/geckodriver
-                       || (
-                               www-client/firefox
-                               www-client/firefox-bin
+               ${RDEPEND}
+               $(python_gen_cond_dep '
+                       dev-python/filetype[${PYTHON_USEDEP}]
+                       dev-python/pytest-mock[${PYTHON_USEDEP}]
+                       test-rust? (
+                               dev-python/pytest[${PYTHON_USEDEP}]
+                               
dev-python/pytest-rerunfailures[${PYTHON_USEDEP}]
+                               dev-python/pytest-xdist[${PYTHON_USEDEP}]
+                               dev-util/selenium-manager
+                               net-misc/geckodriver
+                               || (
+                                       www-client/firefox
+                                       www-client/firefox-bin
+                               )
                        )
-               )
+               ' "${PYTHON_TESTED[@]}")
        )
 "
 
-# xdist is causing random pytest crashes with high job numbers
-distutils_enable_tests pytest
-
 src_prepare() {
        distutils-r1_src_prepare
 
@@ -74,6 +76,8 @@ src_prepare() {
 }
 
 python_test() {
+       # NB: xdist is causing random pytest crashes with high job numbers
+
        if ! has "${EPYTHON/./_}" "${PYTHON_TESTED[@]}"; then
                einfo "Skipping tests on ${EPYTHON}"
                return

Reply via email to