websockets
websockets copied to clipboard
Python 3.11 test failures
When running the test suite using Python 3.11.0b1, I get the following test failures/errors:
$ tox -e py311
GLOB sdist-make: /tmp/websockets/setup.py
py311 create: /tmp/websockets/.tox/py311
py311 inst: /tmp/websockets/.tox/.tmp/package/1/websockets-10.4.dev13+gc4a4b6f.zip
py311 installed: websockets @ file:///tmp/websockets/.tox/.tmp/package/1/websockets-10.4.dev13%2Bgc4a4b6f.zip
py311 run-test-pre: PYTHONHASHSEED='417100899'
py311 run-test: commands[0] | python -W default -m unittest
....................................................................................................................................................................F.................................................................EE................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
======================================================================
ERROR: test_client (tests.legacy.test_client_server.YieldFromTests.test_client)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/websockets/tests/legacy/test_client_server.py", line 128, in _decorate
return func(self, *_args, **_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/websockets/tests/legacy/test_client_server.py", line 1308, in test_client
@asyncio.coroutine
^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'
======================================================================
ERROR: test_server (tests.legacy.test_client_server.YieldFromTests.test_server)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/websockets/tests/legacy/test_client_server.py", line 1322, in test_server
@asyncio.coroutine
^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'
======================================================================
FAIL: test_explicit_socket (tests.legacy.test_client_server.SecureClientServerTests.test_explicit_socket)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/websockets/tests/legacy/test_client_server.py", line 128, in _decorate
return func(self, *_args, **_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/websockets/tests/legacy/test_client_server.py", line 452, in test_explicit_socket
self.assertTrue(client_socket.used_for_read)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: False is not true
----------------------------------------------------------------------
Ran 1016 tests in 2.061s
FAILED (failures=1, errors=2)
ERROR: InvocationError for command /tmp/websockets/.tox/py311/bin/python -W default -m unittest (exited with code 1)
_______________________________________________________________ summary _______________________________________________________________
ERROR: py311: commands failed
I suppose the tests using asyncio.coroutine can just be skipped for Python 3.11. As for the other test, it seems that asyncio is now using .recv_into() rather than .recv(). I'll submit a PR shortly.