commit:     b27e7d4ca0451af40fd656eb80b453dea5fc5928
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 30 16:13:31 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Nov 30 16:16:33 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b27e7d4c

dev-python/cherrypy: Fix test deps, skip memcached on sparc

Fix test dependencies to include all dependencies needed to test
memcached support.  Skip these tests on SPARC where pylibmc is broken.
While at it, disabling plugin autoloading and remove stale deselects.

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

 dev-python/cherrypy/cherrypy-18.10.0.ebuild | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/dev-python/cherrypy/cherrypy-18.10.0.ebuild 
b/dev-python/cherrypy/cherrypy-18.10.0.ebuild
index 4b09ba655dcf..1d8b4cf85e2d 100644
--- a/dev-python/cherrypy/cherrypy-18.10.0.ebuild
+++ b/dev-python/cherrypy/cherrypy-18.10.0.ebuild
@@ -39,7 +39,11 @@ BDEPEND="
                dev-python/objgraph[${PYTHON_USEDEP}]
                dev-python/path[${PYTHON_USEDEP}]
                dev-python/requests-toolbelt[${PYTHON_USEDEP}]
-               dev-python/pytest-services[${PYTHON_USEDEP}]
+               !sparc? (
+                       net-misc/memcached
+                       dev-python/pylibmc[${PYTHON_USEDEP}]
+                       dev-python/pytest-services[${PYTHON_USEDEP}]
+               )
        )
 "
 
@@ -56,11 +60,19 @@ python_prepare_all() {
 
 python_test() {
        local EPYTEST_DESELECT=()
-       [[ ${EPYTHON} == python3.11 ]] && EPYTEST_DESELECT+=(
-               # broken by changes in traceback output
-               
cherrypy/test/test_request_obj.py::RequestObjectTests::testErrorHandling
-               cherrypy/test/test_tools.py::ToolTests::testHookErrors
-       )
+       local opts=()
+
+       # These tests are gracefully skipped when pylibmc is missing but not
+       # if pytest-services is missing -- even though that's the only test
+       # using these fixtures.
+       if ! has_version "dev-python/pytest-services[${PYTHON_USEDEP}]"; then
+               EPYTEST_DESELECT+=(
+                       cherrypy/test/test_session.py::MemcachedSessionTest
+               )
+       else
+               opts+=( -p pytest-services )
+       fi
 
-       epytest
+       local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+       epytest "${opts[@]}"
 }

Reply via email to