summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-06-21 12:08:36 +0200
committerMichał Górny <mgorny@gentoo.org>2020-06-21 12:16:41 +0200
commit47041306d5abf602abb2a3e7580e1592006bf511 (patch)
tree278c71a65185447eb05e9ec624456541cf8b9396 /dev-python/cheroot
parentdev-python/cheroot: Add python@ as co-maint (diff)
downloadgentoo-47041306d5abf602abb2a3e7580e1592006bf511.tar.gz
gentoo-47041306d5abf602abb2a3e7580e1592006bf511.tar.bz2
gentoo-47041306d5abf602abb2a3e7580e1592006bf511.zip
dev-python/cheroot: Backport a better fix for UNIX socket tests
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/cheroot')
-rw-r--r--dev-python/cheroot/cheroot-8.3.0-r1.ebuild6
-rw-r--r--dev-python/cheroot/files/cheroot-8.3.0-test-unixsocket.patch57
2 files changed, 61 insertions, 2 deletions
diff --git a/dev-python/cheroot/cheroot-8.3.0-r1.ebuild b/dev-python/cheroot/cheroot-8.3.0-r1.ebuild
index b5bbaf91d370..4323b58cfedf 100644
--- a/dev-python/cheroot/cheroot-8.3.0-r1.ebuild
+++ b/dev-python/cheroot/cheroot-8.3.0-r1.ebuild
@@ -34,6 +34,10 @@ BDEPEND="
distutils_enable_tests pytest
+PATCHES=(
+ "${FILESDIR}"/cheroot-8.3.0-test-unixsocket.patch
+)
+
python_prepare_all() {
sed -e "s/use_scm_version=True/version='${PV}'/" -i setup.py || die
sed -e '/setuptools_scm/d' -i setup.cfg || die
@@ -45,8 +49,6 @@ python_prepare_all() {
# broken
sed -e '/False.*localhost/d' \
-i cheroot/test/test_ssl.py || die
- sed -e "s:'abstract', 'file':'file',:" \
- -i cheroot/test/test_server.py || die
distutils-r1_python_prepare_all
}
diff --git a/dev-python/cheroot/files/cheroot-8.3.0-test-unixsocket.patch b/dev-python/cheroot/files/cheroot-8.3.0-test-unixsocket.patch
new file mode 100644
index 000000000000..311489565301
--- /dev/null
+++ b/dev-python/cheroot/files/cheroot-8.3.0-test-unixsocket.patch
@@ -0,0 +1,57 @@
+From 6ead1efb37edfade4dda60e48d1af8fe89be3cdc Mon Sep 17 00:00:00 2001
+From: "Jason R. Coombs" <jaraco@jaraco.com>
+Date: Sun, 12 Apr 2020 16:28:00 -0400
+Subject: [PATCH] Remove client from peercreds tests. Fixes #276.
+
+---
+ cheroot/test/test_server.py | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/cheroot/test/test_server.py b/cheroot/test/test_server.py
+index 80728d66..6c4b53ee 100644
+--- a/cheroot/test/test_server.py
++++ b/cheroot/test/test_server.py
+@@ -23,7 +23,6 @@
+ ANY_INTERFACE_IPV4,
+ ANY_INTERFACE_IPV6,
+ EPHEMERAL_PORT,
+- get_server_client,
+ )
+
+
+@@ -171,19 +170,19 @@ def send_payload(self, payload):
+
+
+ @pytest.fixture
+-def peercreds_enabled_server_and_client(http_server, unix_sock_file):
++def peercreds_enabled_server(http_server, unix_sock_file):
+ """Construct a test server with ``peercreds_enabled``."""
+ httpserver = http_server.send(unix_sock_file)
+ httpserver.gateway = _TestGateway
+ httpserver.peercreds_enabled = True
+- return httpserver, get_server_client(httpserver)
++ return httpserver
+
+
+ @unix_only_sock_test
+ @non_macos_sock_test
+-def test_peercreds_unix_sock(peercreds_enabled_server_and_client):
++def test_peercreds_unix_sock(peercreds_enabled_server):
+ """Check that ``PEERCRED`` lookup works when enabled."""
+- httpserver, testclient = peercreds_enabled_server_and_client
++ httpserver = peercreds_enabled_server
+ bind_addr = httpserver.bind_addr
+
+ if isinstance(bind_addr, six.binary_type):
+@@ -212,9 +211,9 @@ def test_peercreds_unix_sock(peercreds_enabled_server_and_client):
+ )
+ @unix_only_sock_test
+ @non_macos_sock_test
+-def test_peercreds_unix_sock_with_lookup(peercreds_enabled_server_and_client):
++def test_peercreds_unix_sock_with_lookup(peercreds_enabled_server):
+ """Check that ``PEERCRED`` resolution works when enabled."""
+- httpserver, testclient = peercreds_enabled_server_and_client
++ httpserver = peercreds_enabled_server
+ httpserver.peercreds_resolve_enabled = True
+
+ bind_addr = httpserver.bind_addr