Closed
Description
Using pytestmark in combination with fixtures that has a skip causes the pytestmark to be ignored.
MWE:
import pytest
pytestmark = pytest.mark.skipif(True, reason='skip all')
# skipifs inside fixture params
params = [pytest.mark.skipif(False, reason='dont skip')('parameter')]
@pytest.fixture(params=params)
def parameter(request):
return request.param
def test_1(parameter):
assert True
returns:
user$ py.test -v
======================================== test session starts =========================================
platform linux2 -- Python 2.7.6, pytest-2.8.3, py-1.4.31, pluggy-0.3.1 -- /usr/bin/python
cachedir: .cache
rootdir: xxx, inifile:
plugins: cov-2.2.0, pep8-1.0.6
collected 1 items
example_test.py::test_1[parameter] PASSED
====================================== 1 passed in 0.00 seconds ======================================