You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this when test.yml was run for my other pull request, #3457. It looks as though a depreciation warning in asyncio is being raised when running the tests on 3.14. Here is one of the tracebacks:
======================================================================
ERROR: test_write_after_close (tornado.test.websocket_test.WebSocketTest.test_write_after_close)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/runner/work/tornado/tornado/.tox/py314-full/lib/python3.14/site-packages/tornado/test/websocket_test.py", line 219, in setUp
super().setUp()
~~~~~~~~~~~~~^^
File "/home/runner/work/tornado/tornado/.tox/py314-full/lib/python3.14/site-packages/tornado/testing.py", line 385, in setUp
super().setUp()
~~~~~~~~~~~~~^^
File "/home/runner/work/tornado/tornado/.tox/py314-full/lib/python3.14/site-packages/tornado/testing.py", line 162, in setUp
asyncio.set_event_loop(self.io_loop.asyncio_loop) # type: ignore[attr-defined]
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.14.0-alpha.4/x64/lib/python3.14/asyncio/events.py", line 843, in set_event_loop
warnings._deprecated('asyncio.set_event_loop', remove=(3,16))
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.14.0-alpha.4/x64/lib/python3.14/warnings.py", line 668, in _deprecated
warn(msg, DeprecationWarning, stacklevel=3)
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DeprecationWarning: 'asyncio.set_event_loop' is deprecated and slated for removal in Python 3.16
I also found pytest-dev/pytest-asyncio#1025 which appears to be the same issue. According to this commentget_event_loop_policy, set_event_loop_policy, and set_event_loop all trigger the warning.
Yeah, this is the next step in some changes that started in Python 3.10. I think for now we should suppress the deprecation warnings (testing.py:148 is the right place to look for a lot of them). I'm not sure if there's a solution that works in all versions of Python we support (back to 3.9) and isn't deprecated in 3.14. I think we might need asyncio.Runner which was added in 3.11.
I ran into this when test.yml was run for my other pull request, #3457. It looks as though a depreciation warning in asyncio is being raised when running the tests on 3.14. Here is one of the tracebacks:
I tried running the tests on different branch without my changes from the PR and it still failed and upon removing the 3.14 tests it succeeded. So, it appears to specifically be an issue with 3.14.
The text was updated successfully, but these errors were encountered: