summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2021-03-15 15:27:37 +0000
committerMarek Szuba <marecki@gentoo.org>2021-03-15 15:37:06 +0000
commit21544ce0cfce90ce900da3226926d14f346544f3 (patch)
tree87ad09474620baa9f31446317873a3205b18744a /www-servers
parentdev-lang/go: remove 1.15.7 (diff)
downloadgentoo-21544ce0cfce90ce900da3226926d14f346544f3.tar.gz
gentoo-21544ce0cfce90ce900da3226926d14f346544f3.tar.bz2
gentoo-21544ce0cfce90ce900da3226926d14f346544f3.zip
www-servers/gunicorn: make worker tests optional rather than skip them altogether
Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'www-servers')
-rw-r--r--www-servers/gunicorn/files/gunicorn-20.1.0-tests_optional_modules.patch22
-rw-r--r--www-servers/gunicorn/gunicorn-20.1.0.ebuild8
2 files changed, 26 insertions, 4 deletions
diff --git a/www-servers/gunicorn/files/gunicorn-20.1.0-tests_optional_modules.patch b/www-servers/gunicorn/files/gunicorn-20.1.0-tests_optional_modules.patch
new file mode 100644
index 000000000000..d04c300c2076
--- /dev/null
+++ b/www-servers/gunicorn/files/gunicorn-20.1.0-tests_optional_modules.patch
@@ -0,0 +1,22 @@
+--- a/tests/workers/test_geventlet.py
++++ b/tests/workers/test_geventlet.py
+@@ -3,5 +3,8 @@
+ # This file is part of gunicorn released under the MIT license.
+ # See the NOTICE for more information.
+
++import pytest
++pytest.importorskip('eventlet')
++
+ def test_import():
+ __import__('gunicorn.workers.geventlet')
+--- a/tests/workers/test_ggevent.py
++++ b/tests/workers/test_ggevent.py
+@@ -3,5 +3,8 @@
+ # This file is part of gunicorn released under the MIT license.
+ # See the NOTICE for more information.
+
++import pytest
++pytest.importorskip('gevent')
++
+ def test_import():
+ __import__('gunicorn.workers.ggevent')
diff --git a/www-servers/gunicorn/gunicorn-20.1.0.ebuild b/www-servers/gunicorn/gunicorn-20.1.0.ebuild
index 7905e095b6ea..cb38379151a0 100644
--- a/www-servers/gunicorn/gunicorn-20.1.0.ebuild
+++ b/www-servers/gunicorn/gunicorn-20.1.0.ebuild
@@ -19,17 +19,17 @@ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x64-mac
RDEPEND="dev-python/setproctitle[${PYTHON_USEDEP}]"
+PATCHES=(
+ "${FILESDIR}"/${PN}-20.1.0-tests_optional_modules.patch
+)
+
DOCS=( README.rst )
distutils_enable_sphinx 'docs/source' --no-autodoc
distutils_enable_tests pytest
src_prepare() {
- # These fail if respective optional packages have not been installed
- rm -f tests/workers/test_g{eventlet,gevent}.py
-
sed -e 's:--cov=gunicorn --cov-report=xml::' -i setup.cfg || die
-
distutils-r1_src_prepare
}