pytest.mark.skip/skipif is not working when pytest bdd decorators are added at function level
See original GitHub issueHi, I am trying to skip test case execution using pytest.mark.skipif() decorator. But its not working when I am using this marker with pytestbdd markers. Is there any solution available to resolve this issue?
Below is the sample code which I am trying to execute.
from pytest_bdd import (
given,
scenarios,
then,
when,
parsers
)
a=5
scenarios('./a.feature')
@pytest.mark.skipif(a==5,reason='matched')
@given(parsers.parse('a is declared'))
def test_ios():
assert 'not executed'
Test case is passing in any condition m_test.py::test_verify_markers PASSED [100%]
Thanks In Advance.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Welcome to Pytest-BDD's documentation! — Pytest-BDD 6.1.1 ...
Functions decorated with the scenario decorator behave like a normal test ... pytest.mark.skip(reason="Not implemented yet") marker(function) return True ...
Read more >How to implement pytest xfail mark with pytest-bdd?
I need to implement @pytest.mark.xfail for one of my step definition. But after adding this decorator, its not working as expected. Example >...
Read more >Pytest-BDD Documentation - Read the Docs
Pytest -BDD Documentation, Release 6.1.1. 1.3 Scenario decorator. Functions decorated with the scenario decorator behave like a normal test ...
Read more >behave - Automation Panda
Although it is not officially part of the Cucumber project, it functions very ... pytest-bdd is very similar to other Python BDD frameworks...
Read more >how to develop tests for a Pokédex using BDD
One of the biggest problems in the software development process is ... In pytest-bdd, we do it by decorating the function with @given(), ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Works fine for me as well. I suppose reporting it to pytest-bdd won’t get anywhere either as long as there’s no reproducer for this…
@aniket02k Could you please show the full pytest output with that reproducer?
Hm, works fine for me. Here is the output with your feature (this is under Windows, but that should not matter):
As you can see, I use pytest-bdd 4.0.2 with pytest 6.2.2 under Python 3.7. What versions and environment are you using?