Simple JSON listener using TCP that listens for data and stores it in a queue for later retrieval.
Installation
Install using your favourite package manager:
pip install pytest-listener
# or..
easy_install pytest-listener
Enable the fixture explicitly in your tests or conftest.py (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}
listener.send(some_data)
data2 = {'bar': 2}
listener.send(some_data)
assert listener.receive() == data1
assert listener.receive() == data2
data3 = {'baz': 3}
listener.send(some_data)
# Clear the listening queue - this deletes data3
listener.clear_queue()
data2 = {'qux': 4}
listener.send(some_data)
assert listener.recieve() == data3
Changelog
1.0.1 (2015-12-23)
Packaging bugfix
1.0.0 (2015-12-21)
Initial public release
Metadata
Release files for pytest-listener 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest-listener-1.0.1.tar.gz | 5.1 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_listener-1.0.1-py2.7.egg | Legacy Egg format | - | - | Details |
| pytest_listener-1.0.1-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 15.7 kB
Release files / pytest-listener-1.0.1.tar.gz
| Download URL | pytest-listener-1.0.1.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a50e0a9165942170c8f04691d39be4d545d5690cd479d1ee47650bc42b59c7fa
|
|
BLAKE2b-256 checksum How to use checksums |
f6574483c1263e0824d680b374cde72c989707389594ba89ed21070c41bc9a06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pytest_listener-1.0.1-py2.7.egg
| Download URL | pytest_listener-1.0.1-py2.7.egg |
|---|---|
| Size | 4.4 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
1f85717ca7a9200ca43511caeac09d3ac26ec7bede0f249adaa33bb3d1e88aa9
|
|
BLAKE2b-256 checksum How to use checksums |
f41e31fa177699cc19ff5bfc3f45c5f247d2aedb5b4f15e1345e20cd299ba42a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pytest_listener-1.0.1-py2-none-any.whl
| Download URL | pytest_listener-1.0.1-py2-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
33090e1e71704d0681f6350d7a9856ce151dc7ce62e6175a9e242aca3f24d53a
|
|
BLAKE2b-256 checksum How to use checksums |
f008aa78908ccbb1e20471c53d0aca9899c4481b63bad4b898046bc8d5676143
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |