crossbario / crossbario/autobahn-python
Example websocket test with pytest and asyncio
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 768
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I'm looking for an example of a functional websocket test that will exercise both client and server in the same test. I'm having a hard time getting https://github.com/crossbario/autobahn-python/blob/master/autobahn/asyncio/test/test_aio_websocket.py to work ( I can see it's marked as skipped, but I still wanted to try to revive it).
Something as simple as the echo client/server example but within pytest would work very well - looking mostly to see how to wire-up the client-server integration with txaio and pytest-asyncio.
The context is that we have a large code-base that is heavily dependent on autobahn-python but existing tests require a running server, which is rather unorthodox, so we've launched a new project to isolate the tests but so far we've been hampered by test setup issues. Any help will be really appreciated.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with autobahn/asyncio/test/test_aio_websocket.py, which the issue identifies as a skipped websocket test, and compare it with the echo client/server example. Investigate how the test should connect the client and server through txaio, pytest, and pytest-asyncio; done means a functional same-test integration example that does not require an externally running server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100