Skip to main content

A simple network listener

Project description

Simple JSON listener using TCP that listens for data and stores it in a queue for later retrieval.


Install using your favourite package manager:

pip install pytest-listener
#  or..
easy_install pytest-listener

Enable the fixture explicitly in your tests or (not required when using setuptools entry points):

pytest_plugins = ['pytest_listener']

Basic Test Usage

Here’s a test showing the basic functionality:

def test_listener(listener):
    data1 = {'foo': 1}

    data2 = {'bar': 2}

    assert listener.receive() == data1
    assert listener.receive() == data2

    data3 = {'baz': 3}

    # Clear the listening queue - this deletes data3

    data2 = {'qux': 4}
    assert listener.recieve() == data3


1.0 (2015-12-21)

  • Initial public release

Project details

Download files

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

Source Distribution

pytest-listener-1.0.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distributions

pytest_listener-1.0.0-py2.7.egg (4.4 kB view hashes)

Uploaded Source

pytest_listener-1.0.0-py2-none-any.whl (6.1 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page