Skip to content

fix(tests): silence websockets deprecation warnings - #783

Open
dokson wants to merge 1 commit into
lexiforest:mainfrom
dokson:fix/test-websockets-deprecation
Open

fix(tests): silence websockets deprecation warnings#783
dokson wants to merge 1 commit into
lexiforest:mainfrom
dokson:fix/test-websockets-deprecation

Conversation

@dokson

@dokson dokson commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Silence the websockets DeprecationWarnings in the test suite. uvicorn's default ws="auto" loads the legacy websockets_impl (deprecated under websockets 15) at server startup, even though the test servers are HTTP-only (the ws tests use websockets.serve directly), so set ws="none" on those Configs.

Also close the session in test_create_session_out_of_async so it no longer leaks an unclosed event loop (ResourceWarning).

Checklist

  • I have manually reviewed the changes and fully understand the code.

uvicorn's default ws="auto" loads the legacy websockets_impl, deprecated
under websockets 15, emitting DeprecationWarnings even though the test
servers are HTTP-only (the ws tests use websockets.serve directly). Set
ws="none" on those Configs.

Also close the session in test_create_session_out_of_async so it no
longer leaks an unclosed event loop (ResourceWarning).
@lexiforest lexiforest added this to the v0.17 milestone Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants