Metadata-Version: 2.4
Name: cucumber-tag-expressions
Version: 6.2.0
Summary: Provides a tag-expression parser and evaluation logic for cucumber/behave
Author-email: Jens Engel <jenisys@noreply.github.com>
License: MIT
Project-URL: Homepage, https://github.com/cucumber/tag-expressions
Project-URL: Download, https://pypi.org/project/cucumber-tag-expressions
Project-URL: Repository, https://github.com/cucumber/tag-expressions
Project-URL: Issues, https://github.com/cucumber/tag-expressions/issues/
Keywords: BDD,testing,cucumber,tag-expressions,behave
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
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 :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=2.7
Description-Content-Type: text/x-rst
Requires-Dist: enum34; python_version < "3.4"
Provides-Extra: develop
Requires-Dist: setuptools; extra == "develop"
Requires-Dist: setuptools-scm; extra == "develop"
Requires-Dist: wheel; extra == "develop"
Requires-Dist: build>=0.5.1; extra == "develop"
Requires-Dist: twine>=1.13.0; extra == "develop"
Requires-Dist: coverage; extra == "develop"
Requires-Dist: pytest<5.0; python_version < "3.0" and extra == "develop"
Requires-Dist: pytest>=5.0; python_version >= "3.0" and extra == "develop"
Requires-Dist: pytest-html>=1.19.0; extra == "develop"
Requires-Dist: tox<4.27,>=4.26; extra == "develop"
Requires-Dist: pylint; extra == "develop"
Requires-Dist: ruff; extra == "develop"
Requires-Dist: invoke>=1.7.3; extra == "develop"
Requires-Dist: six>=1.16.0; extra == "develop"
Requires-Dist: path>=13.1.0; python_version >= "3.5" and extra == "develop"
Requires-Dist: path.py>=11.5.0; python_version < "3.5" and extra == "develop"
Requires-Dist: pathlib; python_version <= "3.4" and extra == "develop"
Requires-Dist: backports.shutil_which; python_version <= "3.3" and extra == "develop"
Requires-Dist: pycmd; extra == "develop"
Provides-Extra: testing
Requires-Dist: pytest<5.0; python_version < "3.0" and extra == "testing"
Requires-Dist: pytest>=5.0; python_version >= "3.0" and extra == "testing"
Requires-Dist: pytest-html>=1.19.0; extra == "testing"
Requires-Dist: PyYAML>=5.4.1; extra == "testing"
Requires-Dist: pathlib; python_version <= "3.4" and extra == "testing"

Cucumber Tag Expressions for Python
===============================================================================

.. |badge.CI_status| image:: https://github.com/cucumber/tag-expressions/actions/workflows/test-python.yml/badge.svg
    :target: https://github.com/cucumber/tag-expressions/actions/workflows/test-python.yml
    :alt: CI Build Status

.. |badge.latest_version| image:: https://img.shields.io/pypi/v/cucumber-tag-expressions.svg
    :target: https://pypi.python.org/pypi/cucumber-tag-expressions
    :alt: Latest Version

.. |badge.license| image:: https://img.shields.io/pypi/l/cucumber-tag-expressions.svg
    :target: https://pypi.python.org/pypi/cucumber-tag-expressions
    :alt: License

.. |badge.downloads| image:: https://img.shields.io/pypi/dm/cucumber-tag-expressions.svg
    :target: https://pypi.python.org/pypi/cucumber-tag-expressions
    :alt: Downloads

.. |logo| image:: https://github.com/cucumber-ltd/brand/raw/master/images/png/notm/cucumber-black/cucumber-black-128.png


|badge.CI_status| |badge.latest_version| |badge.license| |badge.downloads|

Cucumber tag-expressions for Python.

|logo|

Cucumber tag-expressions provide readable boolean expressions
to select features and scenarios marked with tags in Gherkin files
in an easy way::

    # -- SIMPLE TAG-EXPRESSION EXAMPLES:
    @a and @b
    @a or  @b
    not @a

    # -- MORE TAG-EXPRESSION EXAMPLES:
    @a and not @b
    (@a or @b) and not @c

SEE ALSO:

* https://cucumber.io/docs/cucumber/api/#tag-expressions

Getting Started
-----------------------------------------------------------------

Cucumber Tag Expressions is available as `cucumber-tag-expressions <https://pypi.org/project/cucumber-tag-expressions/>`_ on PyPI.

.. code-block:: console

    pip install cucumber-tag-expressions

Parse tag expressions and evaluate them against a set of tags.

.. code-block:: python

    >>> from cucumber_tag_expressions import parse
    >>> # Tagged with @fast
    >>> fast = parse("@fast")
    >>> fast({"@fast", "@wip"})
    True
    >>> fast({"@performance", "@slow"})
    False
    >>> # Tagged with @wip and not @slow
    >>> wip_not_slow = parse("@wip and not @slow")
    >>> wip_not_slow({"@wip", "@home"})
    True
    >>> wip_not_slow({"wet", "warm", "raining"})
    False
    >>> # Tagged with both `@fast` and `@integration`
    >>> fast_integration = parse("@integration and @fast")
    >>> fast_integration({"@integration", "@fast", "@other"})
    True
    >>> fast_integration({"@system", "@fast"})
    False
    >>> # Tagged with either @login or @registration
    >>> auth_pages = parse("@login or @registration")
    >>> auth_pages({"@account", "@login"})
    True
    >>> auth_pages({"@admin", "@account"})
    False

Test Runner Usage
-----------------------------------------------------------------

A cucumber test runner selects some scenarios by using tag-expressions and runs them:

.. code:: sh

    # -- TAG-EXPRESSION: @one and @two
    # EXPECTED: Selects and runs scenario "Three".
    $ my_cucumber_test_runner --tags="@one and @two" features/example.feature
    ...

    # -- TAG-EXPRESSION: @one or @two
    # EXPECTED: Selects and runs scenarios "One", "Two" and "Three".
    $ my_cucumber_test_runner --tags="@one or @two" features/example.feature
    ...

by using the following feature file:

.. code:: gherkin

    # -- FILE: features/example.feature
    Feature: Tag-Expressions Example

      @one
      Scenario: One
        Given a step passes

      @two
      Scenario: Two
        Given another step passes

      @one @two
      Scenario: Three
        Given some step passes

      Scenario: Four
        Given another step passes
