Metadata-Version: 2.1
Name: pytest-himark
Version: 0.1.3
Summary: A plugin that will filter pytest's test collection using a json file. It will read a json file provided with a --json argument in pytest command line (or in pytest.ini), search the markers key and automatically add -m option to the command line for filtering out the tests marked with disabled markers.
Author-email: Rodolphe Mete Soyding <r.soyding@gmail.com>
Maintainer-email: Rodolphe Mete Soyding <r.soyding@gmail.com>
License: 
        The MIT License (MIT)
        
        Copyright (c) 2024 Rodolphe Mete Soyding
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
        
Project-URL: Repository, https://github.com/supermete/pytest-himark
Classifier: Framework :: Pytest
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Testing
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: pytest>=6.2.0

=============
pytest-himark
=============

.. image:: https://img.shields.io/pypi/v/pytest-himark.svg
    :target: https://pypi.org/project/pytest-himark
    :alt: PyPI version

.. image:: https://img.shields.io/pypi/pyversions/pytest-himark.svg
    :target: https://pypi.org/project/pytest-himark
    :alt: Python versions

.. image:: https://github.com/supermete/pytest-himark/actions/workflows/main.yml/badge.svg
    :target: https://github.com/supermete/pytest-himark/actions/workflows/main.yml
    :alt: See Build Status on GitHub Actions

A plugin that will filter pytest's test collection using a json file.
It will read a json file provided with a --json argument in pytest command line
(or in pytest.ini), search the 'markers' key and automatically add -m option to
the command line for filtering out the tests marked with disabled markers.

----

This `pytest`_ plugin was generated with `Cookiecutter`_ along with `@hackebrot`_'s `cookiecutter-pytest-plugin`_ template.


Requirements
------------

* json >= 2.0.9


Installation
------------

You can install "pytest-himark" via `pip`_ from `PyPI`_::

    $ pip install pytest-himark


Usage
-----

After installing this plugin, pytest will automatically load it when launching tests.
You will simply need to add the --json option to the command line with the path to the
json containing the markers you want to enable. Alternatively, you can add the --json
option and the path in the pytest.ini directly, in the addopts variable.

Example:
    - pytest.ini:

    .. code-block:: INI

        addopts = --json=path/to/my/config.json

    - config.json:

.. code-block:: JSON

        {
            "markers": {
                "my_marker1": true,
                "my_marker2": true,
                "my_marker3": false,
                "my_marker4": false
            }
        }

..

    Launching pytest now will automatically add he following to the command line:

.. code-block:: python

    >> pytest -m "(my_marker1 or my_marker2) and not (my_marker3 or my_marker4)"


Contributing
------------
Contributions are very welcome. Tests can be run with `tox`_, please ensure
the coverage at least stays the same before you submit a pull request.

License
-------

Distributed under the terms of the `MIT`_ license, "pytest-himark" is free and open source software


Issues
------

If you encounter any problems, please `file an issue`_ along with a detailed description.

.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter
.. _`@hackebrot`: https://github.com/hackebrot
.. _`MIT`: https://opensource.org/licenses/MIT
.. _`BSD-3`: https://opensource.org/licenses/BSD-3-Clause
.. _`GNU GPL v3.0`: https://www.gnu.org/licenses/gpl-3.0.txt
.. _`Apache Software License 2.0`: https://www.apache.org/licenses/LICENSE-2.0
.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin
.. _`file an issue`: https://github.com/supermete/pytest-himark/issues
.. _`pytest`: https://github.com/pytest-dev/pytest
.. _`tox`: https://tox.readthedocs.io/en/latest/
.. _`pip`: https://pypi.org/project/pip/
.. _`PyPI`: https://pypi.org/project
