All Projects → ClearcodeHQ → pytest-rabbitmq

ClearcodeHQ / pytest-rabbitmq

Licence: LGPL-3.0, GPL-3.0 licenses found Licenses found LGPL-3.0 COPYING.lesser GPL-3.0 COPYING
This is a pytest plugin, that enables you to test your code that relies on a running RabbitMQ Queues. It allows you to specify additional fixtures for RabbitMQ process and client.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pytest-rabbitmq

pytest-elk-reporter
A plugin to send pytest test results to ELK stack
Stars: ✭ 17 (-50%)
Mutual labels:  pytest-plugin
pytest-notebook
A pytest plugin for regression testing and regenerating Jupyter Notebooks
Stars: ✭ 35 (+2.94%)
Mutual labels:  pytest-plugin
pytest-djangoapp
Nice pytest plugin to help you with Django pluggable application testing.
Stars: ✭ 35 (+2.94%)
Mutual labels:  pytest-plugin
pytest-mongo
This is a pytest plugin, that enables you to test your code that relies on a running MongoDB database. It allows you to specify fixtures for MongoDB process and client.
Stars: ✭ 18 (-47.06%)
Mutual labels:  pytest-plugin
pytest-eth
PyTest plugin for testing smart contracts for Ethereum blockchain.
Stars: ✭ 23 (-32.35%)
Mutual labels:  pytest-plugin
pytest-split
Pytest plugin which splits the test suite to equally sized "sub suites" based on test execution time.
Stars: ✭ 93 (+173.53%)
Mutual labels:  pytest-plugin
pytest-aiohttp
pytest plugin for aiohttp support
Stars: ✭ 110 (+223.53%)
Mutual labels:  pytest-plugin
Pudb
Full-screen console debugger for Python
Stars: ✭ 2,267 (+6567.65%)
Mutual labels:  pytest-plugin
playwright-pytest
Pytest plugin to write end-to-end browser tests with Playwright.
Stars: ✭ 214 (+529.41%)
Mutual labels:  pytest-plugin
pytest-redis
Redis fixtures and fixture factories for Pytest.This is a pytest plugin, that enables you to test your code that relies on a running Redis database. It allows you to specify additional fixtures for Redis process and client.
Stars: ✭ 68 (+100%)
Mutual labels:  pytest-plugin
pytest-pipeline
Pytest plugin for functional testing of data analysis pipelines
Stars: ✭ 19 (-44.12%)
Mutual labels:  pytest-plugin
pytest-mock-server
Mock server plugin for pytest
Stars: ✭ 19 (-44.12%)
Mutual labels:  pytest-plugin
pytest-snapshot
A plugin for snapshot testing with pytest.
Stars: ✭ 68 (+100%)
Mutual labels:  pytest-plugin
pytest-test-groups
A Pytest plugin that gives you a way to split your tests into groups of a specific size
Stars: ✭ 37 (+8.82%)
Mutual labels:  pytest-plugin
pytest-reportlog
Replacement for the --resultlog option, focused in simplicity and extensibility
Stars: ✭ 36 (+5.88%)
Mutual labels:  pytest-plugin
pytest-datafixtures
Data fixtures for pytest made simple
Stars: ✭ 24 (-29.41%)
Mutual labels:  pytest-plugin
pytest-localstack
Pytest plugin for local AWS integration tests
Stars: ✭ 66 (+94.12%)
Mutual labels:  pytest-plugin
Seleniumbase
A Python framework that inspires developers to become better test automation engineers. 🧠💡
Stars: ✭ 2,520 (+7311.76%)
Mutual labels:  pytest-plugin
Pytest Testinfra
With Testinfra you can write unit tests in Python to test actual state of your servers configured by management tools like Salt, Ansible, Puppet, Chef and so on.
Stars: ✭ 1,987 (+5744.12%)
Mutual labels:  pytest-plugin
pytest-arraydiff
pytest plugin to facilitate comparison of results to a pre-defined reference
Stars: ✭ 12 (-64.71%)
Mutual labels:  pytest-plugin

https://raw.githubusercontent.com/ClearcodeHQ/pytest-rabbitmq/master/logo.png

pytest-rabbitmq

Latest PyPI version Wheel Status Supported Python Versions License

Package status

Tests Coverage Status

What is this?

This is a pytest plugin, that enables you to test your code that relies on a running RabbitMQ Queues. It allows you to specify additional fixtures for RabbitMQ process and client.

How to use

Plugin contains two fixtures

  • rabbitmq - it's a client fixture that has functional scope. After each test, it cleans RabbitMQ, cleans queues and exchanges for more reliable tests.
  • rabbitmq_proc - session scoped fixture, that starts RabbitMQ instance at it's first use and stops at the end of the tests.

Simply include one of these fixtures into your tests fixture list.

You can also create additional rabbitmq client and process fixtures if you'd need to:

from pytest_rabbitmq import factories

rabbitmq_my_proc = factories.rabbitmq_proc(
    port=None, logsdir='/tmp')
rabbitmq_my = factories.rabbitmq('rabbitmq_my_proc')

Note

Each RabbitMQ process fixture can be configured in a different way than the others through the fixture factory arguments.

Configuration

You can define your settings in three ways, it's fixture factory argument, command line option and pytest.ini configuration option. You can pick which you prefer, but remember that these settings are handled in the following order:

  • Fixture factory argument
  • Command line option
  • Configuration option in your pytest.ini file
Configuration options
RabbitMQ option Fixture factory argument Command line option pytest.ini option Default
host host --rabbitmq-host rabbitmq_host 127.0.0.1
port port --rabbitmq-port rabbitmq_port random
rabbitmqctl path ctl --rabbitmq-ctl rabbitmq_ctl /usr/lib/rabbitmq/bin/rabbitmqctl
rabbitmq server path server --rabbitmq-server rabbitmq_server /usr/lib/rabbitmq/bin/rabbitmq-server
Log directory location logsdir --rabbitmq-logsdir rabbitmq_logsdir $TMPDIR
Plugin directory location plugin_path --rabbitmq-plugindir rabbitmq_plugindir $TMPDIR
Node name node --rabbitmq-node rabbitmq_node rabbitmq-test-{port}

Example usage:

  • pass it as an argument in your own fixture

    rabbitmq_proc = factories.rabbitmq_proc(port=8888)
  • use --rabbitmq-port command line option when you run your tests

    py.test tests --rabbitmq-port=8888
    
  • specify your port as rabbitmq_port in your pytest.ini file.

    To do so, put a line like the following under the [pytest] section of your pytest.ini:

    [pytest]
    rabbitmq_port = 8888

Package resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].