How to use select_tag_expression_parser method in Behave

Best Python code snippet using behave

Run Behave automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Source: Github

1# -*- coding: UTF-8 -*-
3from behave.tag_expression import (
4    make_tag_expression, select_tag_expression_parser,
5    parse_tag_expression_v1, parse_tag_expression_v2
7from behave.tag_expression.v1 import TagExpression as TagExpressionV1
8from behave.tag_expression.model_ext import Expression as TagExpressionV2
9import pytest
11# -----------------------------------------------------------------------------
12# TEST SUITE FOR: make_tag_expression()
13# -----------------------------------------------------------------------------
14def test_make_tag_expression__with_v1():
15    pass
17def test_make_tag_expression__with_v2():
18    pass
21# -----------------------------------------------------------------------------
22# TEST SUITE FOR: select_tag_expression_parser()
23# -----------------------------------------------------------------------------
24@pytest.mark.parametrize("text", [
25    "@foo @bar",
26    "foo bar",
27    "-foo",
28    "~foo",
29    "[email protected]",
30    "[email protected]",
31    "@foo,@bar",
32    "[email protected] [email protected]_implemented",
34def test_select_tag_expression_parser__with_v1(text):
35    parser = select_tag_expression_parser(text)
36    assert parser is parse_tag_expression_v1, "tag_expression: %s" % text
39@pytest.mark.parametrize("text", [
40    "@foo",
41    "foo",
42    "not foo",
43    "foo and bar",
44    "@foo or @bar",
45    "(@foo and @bar) or @baz",
46    "not @xfail or not @not_implemented"
48def test_select_tag_expression_parser__with_v2(text):
49    parser = select_tag_expression_parser(text)
50    assert parser is parse_tag_expression_v2, "tag_expression: %s" % text
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Run Python Tests on LambdaTest Cloud Grid

Execute automation tests with Behave on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)