Convert test suite from sync to async style#6
Merged
Conversation
Co-authored-by: Creeper19472 <38857196+Creeper19472@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Convert current tests to async style
Convert test suite from sync to async style
Nov 10, 2025
Collaborator
|
@copilot You should mark async functions with @pytest.mark.asyncio, @pytest_asyncio.fixture, etc. to make sure the tests will run correctly. |
- Add @pytest.mark.asyncio to all 51 async test functions - Change async fixtures to use @pytest_asyncio.fixture - Import pytest_asyncio in conftest.py Co-authored-by: Creeper19472 <38857196+Creeper19472@users.noreply.github.com>
Contributor
Author
Done! Added explicit markers in commit 8ae2b45:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Async Test Conversion - Complete ✅
Successfully converted all tests from synchronous to asynchronous style.
Summary of Changes
Files Modified: 9
tests/test_client.py- Async WebSocket clienttests/conftest.py- Async fixtures with @pytest_asyncio.fixturetests/test_basic.py- 13 async test functions with @pytest.mark.asynciotests/test_users.py- 11 async test functions with @pytest.mark.asynciotests/test_documents.py- 10 async test functions with @pytest.mark.asynciotests/test_directories.py- 8 async test functions with @pytest.mark.asynciotests/test_groups.py- 10 async test functions with @pytest.mark.asynciotests/test_debugging.py- 1 async test function with @pytest.mark.asynciopytest.ini- Added asyncio configurationTotal Test Functions Converted: 51
Key Changes
Test Client (test_client.py)
websockets.sync.clienttowebsockets.client__aenter__/__aexit__)Fixtures (conftest.py)
@pytest_asyncio.fixturedecoratorTest Files
async def test_...@pytest.mark.asyncioawaitConfiguration (pytest.ini)
asyncio_mode = autoasyncio_default_fixture_loop_scope = functionVerification
✅ All 51 test functions converted to async with explicit markers
✅ All 5 async fixtures use @pytest_asyncio.fixture
✅ Zero synchronous test functions remaining
✅ All WebSocket operations use async/await
✅ Compatible with pytest-asyncio
The tests are now fully async with explicit markers and ready for use with modern async WebSocket patterns.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.