Skip test depending on parameter in py.test
Found solution myself, one can define function in conftest.py
:
def pytest_namespace():
return {"param": None}
And in fixture function we can do:
@pytest.fixture(scope="session", params=["one", "two", "three"])
def myfixture():
pytest.param = request.param
# ...
So we can wrap test class with:
@pytest.mark.skipif("pytest.param == 'value'")
class TestSmth(object):
...