dev-python/cherrypy: Fix tests

Closes: https://bugs.gentoo.org/727240
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2020-06-21 20:50:22 +02:00
parent 61b6d26b74
commit cc3e38b6b2
2 changed files with 6 additions and 27 deletions

View File

@@ -25,24 +25,20 @@ RDEPEND=">=dev-python/cheroot-8.2.1[${PYTHON_USEDEP}]
dev-python/zc-lockfile[${PYTHON_USEDEP}]
dev-python/jaraco-collections[${PYTHON_USEDEP}]
ssl? ( dev-python/pyopenssl[${PYTHON_USEDEP}] )"
BDEPEND="${RDEPEND}
BDEPEND="
dev-python/setuptools[${PYTHON_USEDEP}]
dev-python/setuptools_scm[${PYTHON_USEDEP}]
test? (
${RDEPEND}
dev-python/routes[${PYTHON_USEDEP}]
dev-python/simplejson[${PYTHON_USEDEP}]
dev-python/objgraph[${PYTHON_USEDEP}]
dev-python/backports-unittest-mock[${PYTHON_USEDEP}]
dev-python/path-py[${PYTHON_USEDEP}]
dev-python/requests-toolbelt[${PYTHON_USEDEP}]
dev-python/pytest-services[${PYTHON_USEDEP}]
)
"
PATCHES=(
"${FILESDIR}/cherrypy-18.5.0-tests.patch"
)
distutils_enable_tests pytest
python_prepare_all() {
@@ -50,6 +46,10 @@ python_prepare_all() {
sed -e 's|@pytest.mark.xfail(py27_on_windows|@pytest.mark.xfail(sys.version_info < (3,)|' \
-i cherrypy/test/test_static.py || die
# fragile, fails with newer versions of CPython
sed -e 's:testCombinedTools:_&:' \
-i cherrypy/test/test_tools.py || die
sed -r -e '/(pytest-sugar|pytest-cov)/ d' \
-i setup.py || die

View File

@@ -1,21 +0,0 @@
diff --git a/cherrypy/test/test_tools.py b/cherrypy/test/test_tools.py
index 3a0fd389..e357a445 100644
--- a/cherrypy/test/test_tools.py
+++ b/cherrypy/test/test_tools.py
@@ -9,6 +9,8 @@ import unittest
import operator
from http.client import IncompleteRead
+import pytest
+
import cherrypy
from cherrypy import tools
from cherrypy._cpcompat import ntou
@@ -343,6 +345,7 @@ class ToolTests(helper.CPWebCase):
expected_msg = tmpl.format(attr='items')
self.assertInBody(expected_msg)
+ @pytest.mark.skipif('sys.hexversion >= 0x03080000')
def testCombinedTools(self):
expectedResult = (ntou('Hello,world') +
europoundUnicode).encode('utf-8')