Skip to main content

Cucumber logo
Cucumber Tag Expressions

Readable boolean expressions to select features and scenarios marked with tags in Gherkin

npm build backers sponsors build

# -- 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

Getting Started

Cucumber Tag Expressions is available as cucumber-tag-expressions on PyPI.

pip install cucumber-tag-expressions

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

>>> 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 gherkin test runner (such as behave) uses tag expressions to select scenarios to run.

# -- 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
...

Such as using the following feature file.

# -- 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

Metadata

Release files for cucumber-tag-expressions 11.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cucumber-tag-expressions 11.2.0
File Size Uploaded Provenance Actions
cucumber_tag_expressions-11.2.0.tar.gz 9.1 kB Without provenance Details for cucumber_tag_expressions-11.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cucumber-tag-expressions 11.2.0
File Interpreter ABI Platform Actions
cucumber_tag_expressions-11.2.0-py3-none-any.whl Python 3 none any Details for cucumber_tag_expressions-11.2.0-py3-none-any.whl

Total release size: 18.8 kB

Release files / cucumber_tag_expressions-11.2.0.tar.gz

Download URL cucumber_tag_expressions-11.2.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7de37ff754acd8a09a62ce37183ba235d7d1bcbfde17ea1bdbb2de517b689273
BLAKE2b-256 checksum
How to use checksums
642b2d1a802925ab61e7397eb6cc782e3347719fff4a6d02dac9a52ab4da0e0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cucumber_tag_expressions-11.2.0-py3-none-any.whl

Download URL cucumber_tag_expressions-11.2.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5760708e55981dab6a8ce5c8c6be074077aba0b9585ebd20775a0225bd472cb6
BLAKE2b-256 checksum
How to use checksums
69175205be62917140bde1dc3a8327059d6fc5640f47f29473c504b4017e9a64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cucumber-tag-expressions 11.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

11.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page