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 (2015-12-21)
Initial public release
Metadata
Release files for pytest-listener 1.0.0
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.0.tar.gz | 4.1 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_listener-1.0.0-py2.7.egg | Legacy Egg format | - | - | Details |
| pytest_listener-1.0.0-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 14.6 kB
Release files / pytest-listener-1.0.0.tar.gz
| Download URL | pytest-listener-1.0.0.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22c9b47650745c9b703cdaea16c50fa8cd9ca8a7d1a0303b6059739c8fe895b1
|
|
BLAKE2b-256 checksum How to use checksums |
5f0e541ab2a27e98086ef5a8d2058ddf83d94c0b3fc99fd6aa1a19d381fa3ac0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pytest_listener-1.0.0-py2.7.egg
| Download URL | pytest_listener-1.0.0-py2.7.egg |
|---|---|
| Size | 4.4 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
048dae461a9a4405fc5a406ae6f0c7d905229fed2b5dba64287ea68f70a8a572
|
|
BLAKE2b-256 checksum How to use checksums |
0b150a9dd00b3bc3de93e044a5d77d436f0fd11fe625dc2f3e87b11e856feb4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pytest_listener-1.0.0-py2-none-any.whl
| Download URL | pytest_listener-1.0.0-py2-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
b95523e83da9b1e12ca31fb05aff8859d56dff21a023c95246e321b85635dc19
|
|
BLAKE2b-256 checksum How to use checksums |
8bbfeaac0a09c422fe0072ccab685b17c6efdf2e529447344b7e20af69f33b28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |