dev-python/websockets: Enable py3.11

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2022-05-15 10:35:41 +02:00
parent 75046b682d
commit 8f041477bd
2 changed files with 29 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
diff --git a/tests/legacy/test_client_server.py b/tests/legacy/test_client_server.py
index f9de70c..05070c8 100644
--- a/tests/legacy/test_client_server.py
+++ b/tests/legacy/test_client_server.py
@@ -426,6 +426,10 @@ class CommonClientServerTests:
self.used_for_read = True
return super().recv(*args, **kwargs)
+ def recv_into(self, *args, **kwargs):
+ self.used_for_read = True
+ return super().recv_into(*args, **kwargs)
+
def send(self, *args, **kwargs):
self.used_for_write = True
return super().send(*args, **kwargs)
@@ -1299,6 +1303,8 @@ class ClientServerOriginTests(ClientServerTestsMixin, AsyncioTestCase):
self.assertEqual(self.loop.run_until_complete(self.client.recv()), "Hello!")
+@unittest.skipIf(sys.version_info[:2] >= (3, 11),
+ "asyncio.coroutine has been removed in Python 3.11")
class YieldFromTests(ClientServerTestsMixin, AsyncioTestCase):
@with_server()
def test_client(self):

View File

@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( pypy3 python3_{8..10} )
PYTHON_COMPAT=( pypy3 python3_{8..11} )
inherit distutils-r1
@@ -25,6 +25,10 @@ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~
distutils_enable_tests pytest
PATCHES=(
"${FILESDIR}/${P}-py311.patch"
)
python_test() {
local EPYTEST_DESELECT=(
# very fragile to speed