Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tags: --tags option not properly picking up tests (all scenarios skipped) when using logical "or" #763

Closed
glenn-barker opened this issue Jul 16, 2019 · 6 comments

Comments

@glenn-barker
Copy link

glenn-barker commented Jul 16, 2019

I have the following (very) simple feature file:

Feature: FizzBuzz
  As a tester
  I want to be able to run both "Fizz" or "Buzz" scenario by specifying their appropriate tags
  So that I can confirm granular control over scenario execution


@fizz
Scenario: Fizz scenario
  When this scenario is executed
  Then "fizz" should be printed to the console


@buzz
Scenario: Buzz scenario
  When this scenario is executed
  Then "buzz" should be printed to the console

I'm able to run the scenarios on an individual basis by running:
$ behave --tags="fizz"
$ behave --tags="buzz"
Both of these produce the expected output: 1 scenario executed, 1 skipped.

However, consider the following:
$ behave --tags="fizz or buzz"

Expected behavior: 2 scenarios executed, 0 skipped.
Actual behavior: 0 scenarios executed, 2 skipped.

Basically, trying to use "or" to select multiple tags to execute on just results in every scenario being skipped.

REFERENCE: https://behave.readthedocs.io/en/latest/behave.html#tag-expression

@jenisys
Copy link
Member

jenisys commented Jul 18, 2019

Which version of behave are you using ?
Any version below 1.2.7 does not support the new tag-expression v2 (as described in the docs).

SEE ALSO:

@jenisys jenisys changed the title --tags param not properly picking up tests (all scenarios skipped) when using or tags: --tags option not properly picking up tests (all scenarios skipped) when using logical "or" Jul 18, 2019
@glenn-barker
Copy link
Author

I see, I'm on 1.2.6 so that explains it. That seems to be the latest stable version that you get when you install via pip install behave, so is 1.2.7 still considered a bleeding-edge / unstable version?

I guess I was just looking at the wrong docs, so I'm closing this.

@vishrantgupta
Copy link

@jenisys it's been a long time since a stable version of behave has been released, any plans of releasing the stable version of behave which can support https://behave.readthedocs.io/en/latest/tag_expressions.html#tag-matching-with-tag-expressions?

@vishrantgupta
Copy link

Also, how can I install behave 1.2.7 any PyPi indexUrl?

@bittner
Copy link
Member

bittner commented Nov 4, 2022

@jenisys it's been a long time since a stable version of behave has been released, any plans of releasing the stable version of behave which can support https://behave.readthedocs.io/en/latest/tag_expressions.html#tag-matching-with-tag-expressions?

You may take a look at the discussion in #855 and #1059. How to install any code point from Git using pip is also mentioned in the latter (and in the docs).

@jenisys
Copy link
Member

jenisys commented Nov 5, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants