Skip to main content

pytest-play support for websockets

Project description

play websocket Documentation Status

pytest-play support for websockets

More info and examples on:


This project defines new pytest-play commands.


{'type': 'connect',
 'provider': 'play_websocket',
 'options': {
     'url': 'ws://',
     'timeout': 2


{'type': 'send',
 'provider': 'play_websocket',
 'url': 'ws://',
 'payload': 'Hello!'}


{'type': 'recv',
 'provider': 'play_websocket',
 'url': 'ws://',
 'variable': 'data',
 'variable_expression': 'response.upper()',
 'assertion': 'data == "HELLO!"',
 'timeout': 10}

Receive until

If you want to filter the data returned by the websocked until you get what you expect:

{'provider': 'python',
 'type': 'wait_until',
 'expression': 'variables['data'] == "HELLO!"',
 'timeout': 60,
 'poll': 0,
 'sub_commands': [
      'type': 'recv',
      'provider': 'play_websocket',
      'url': 'ws://',
      'variable': 'data',
      'variable_expression': 'response.upper()',
      'timeout': 60}


pytest-play tweets happens here:


This package was created with Cookiecutter and the cookiecutter-play-plugin (based on audreyr/cookiecutter-pypackage project template).


0.0.1 (2018-01-25)

  • First release.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for play-websocket, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size play_websocket-0.0.1-py2.py3-none-any.whl (5.7 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size play_websocket-0.0.1.tar.gz (17.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page