Cucumber Tag Expressions
Readable boolean expressions to select features and scenarios marked with tags in Gherkin
# -- 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.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cucumber_tag_expressions-11.0.1.tar.gz | 8.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cucumber_tag_expressions-11.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.4 kB
Release files / cucumber_tag_expressions-11.0.1.tar.gz
| Download URL | cucumber_tag_expressions-11.0.1.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8304dd16e546517816e62ace6c486575023812f42e8a60526fcec1694016146
|
|
BLAKE2b-256 checksum How to use checksums |
50e0c2741558040293465d615a4f2555e9180c54a559119b96ff0251dda5fa90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.0.1-py3-none-any.whl
| Download URL | cucumber_tag_expressions-11.0.1-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ee5433a3b1ad16ca607c905fa3bb6d85d57f087ba119b14ea5e82cd35ea98c5
|
|
BLAKE2b-256 checksum How to use checksums |
f82a894aded5804c76cf148965721cb57fed0d923ddb2747a77c9147f20d58a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.0.1
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.