crossbario / crossbario/autobahn-python

Example websocket test with pytest and asyncio

Open
#1,485 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.