Metadata-Version: 2.1
Name: pytest-elasticsearch
Version: 1.3.0
Summary: Elasticsearch process and client fixtures for py.test.
Home-page: https://github.com/ClearcodeHQ/pytest-elasticsearch
Author: Clearcode - The A Room
Author-email: thearoom@clearcode.cc
License: LGPLv3+
Description: pytest-elasticsearch
        ====================
        
        .. image:: https://img.shields.io/pypi/v/pytest-elasticsearch.svg
            :target: https://pypi.python.org/pypi/pytest-elasticsearch/
            :alt: Latest PyPI version
        
        .. image:: https://img.shields.io/pypi/wheel/pytest-elasticsearch.svg
            :target: https://pypi.python.org/pypi/pytest-elasticsearch/
            :alt: Wheel Status
        
        .. image:: https://img.shields.io/pypi/pyversions/pytest-elasticsearch.svg
            :target: https://pypi.python.org/pypi/pytest-elasticsearch/
            :alt: Supported Python Versions
        
        .. image:: https://img.shields.io/pypi/l/pytest-elasticsearch.svg
            :target: https://pypi.python.org/pypi/pytest-elasticsearch/
            :alt: License
        
        Package status
        --------------
        
        .. image:: https://travis-ci.org/ClearcodeHQ/pytest-elasticsearch.svg?branch=v1.3.0
            :target: https://travis-ci.org/ClearcodeHQ/pytest-elasticsearch
            :alt: Tests
        
        .. image:: https://coveralls.io/repos/ClearcodeHQ/pytest-elasticsearch/badge.png?branch=v1.3.0
            :target: https://coveralls.io/r/ClearcodeHQ/pytest-elasticsearch?branch=v1.3.0
            :alt: Coverage Status
        
        .. image:: https://requires.io/github/ClearcodeHQ/pytest-elasticsearch/requirements.svg?tag=v1.3.0
             :target: https://requires.io/github/ClearcodeHQ/pytest-elasticsearch/requirements/?tag=v1.3.0
             :alt: Requirements Status
        
        What is this?
        =============
        
        This is a pytest plugin that enables you to test your code that relies on a running Elasticsearch search engine.
        It allows you to specify fixtures for Elasticsearch process and client.
        
        How to use
        ==========
        
        .. warning::
        
            This fixture requires at least version 1.0 of elasticsearch to work.
        
        The plugin contains two fixtures:
        
        * **elasticsearch** - a client fixture that has functional scope, and which cleans Elasticsearch at the end of each test.
        * **elasticsearch_proc** - a session scoped fixture, that starts Elasticsearch instance at its 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 elasticsearch client and process fixtures if you'd need to:
        
        
        .. code-block:: python
        
            from pytest_elasticsearch import factories
        
            elasticsearch_my_proc = factories.elasticsearch_proc(
                port=None, logsdir='/tmp')
            elasticsearch_my = factories.elasticsearch('elasticsearch_my_proc')
        
        .. note::
        
            Each elasticsearch 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:
        
        1. Fixture factory argument
        2. Command line option
        3. Configuration option in your pytest.ini file
        
        +----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+------------------------------+
        | Elasticsearch option | Fixture factory argument             | Command line option                                  | pytest.ini option                                  | Default                      |
        +======================+======================================+======================================================+====================================================+==============================+
        | logs directory       | logsdir                              | --elasticsearch-logsdir                              | elasticsearch_logsdir                              | $TMPDIR                      |
        +----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+------------------------------+
        | host                 | host                                 | --elasticsearch-host                                 | elasticsearch_host                                 | 127.0.0.1                    |
        +----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+------------------------------+
        | port                 | port                                 | --elasticsearch-port                                 | elasticsearch_port                                 | random                       |
        +----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+------------------------------+
        | cluster_name         | cluster_name                         | --elasticsearch-cluster-name                         | elasticsearch_cluster_name                         | elasticsearch_cluster_<port> |
        +----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+------------------------------+
        | index store type     | index_store_type                     | --elasticsearch-index-store-type                     | elasticsearch_index_store_type                     | memory                       |
        +----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+------------------------------+
        | network publish host | network_publish_host                 | --elasticsearch-network-publish-host                 | elasticsearch_network_publish_host                 | 127.0.0.1                    |
        +----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+------------------------------+
        | logs prefix          | logs_prefix                          | --elasticsearch-logs-prefix                          | elasticsearch_logs_prefix                          |                              |
        +----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+------------------------------+
        | enable zen discovery | discovery_zen_ping_multicast_enabled | --elasticsearch-discovery-zen-ping-multicast-enabled | elasticsearch_discovery_zen_ping_multicast_enabled | False                        |
        +----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+------------------------------+
        | transport tcp port   | transport_tcp_port                   | --elasticsearch-transport-tcp-port                   | elasticsearch_transport_tcp_port                   | random                       |
        +----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+------------------------------+
        | configuration path   | configuration_path                   | --elasticsearch-configuration-path                   | elasticsearch_configuration_path                   | /etc/elasticsearch           |
        +----------------------+--------------------------------------+------------------------------------------------------+----------------------------------------------------+------------------------------+
        
        Example usage:
        
        * pass it as an argument in your own fixture
        
            .. code-block:: python
        
                elasticsearch_proc = factories.elasticsearch_proc(
                    cluster_name='awsome_cluster)
        
        * use ``--elasticsearch-logsdir`` command line option when you run your tests
        
            .. code-block::
        
                py.test tests --elasticsearch-cluster-name=awsome_cluster
        
        
        * specify your directory as ``elasticsearch_cluster_name`` in your ``pytest.ini`` file.
        
            To do so, put a line like the following under the ``[pytest]`` section of your ``pytest.ini``:
        
            .. code-block:: ini
        
                [pytest]
                elasticsearch_cluster_name = awsome_cluster
        
        Package resources
        -----------------
        
        * Bug tracker: https://github.com/ClearcodeHQ/pytest-elasticsearch/issues
        
        
        CHANGELOG
        =========
        
        1.3.0
        -------
        
        - [feature] - Support for major elasticsearch versions
        
        
        1.2.1
        -------
        
        - [cleanup] - removed path.py dependency
        
        1.2.0
        -------
        
        - [feature] - migrate usage of getfuncargvalue to getfixturevalue. require at least pytest 3.0.0
        - [feature] - default logsdir to $TMPDIR
        - [feature] - run process on random port by default - enhances xdist experience
        
        1.1.0
        -------
        
        - [feature] use tmpfile.gettempdir instead of hardcoded /tmp directory
        - [docs] added description to all command line and ini options
        - [bugfix] made command line option's dests more distinc, to prevent from influencing other pytest plugins
        
        1.0.0
        -------
        
        - [feature] pytest.ini option for every command line option
        - [feature] Command line options for every fixture factory argument
        - Extracted original code from pytest-dbfixtures
        
Keywords: tests py.test pytest fixture elasticsearch
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: docs
Provides-Extra: tests
