I am running a py.test with a fixture in a conftest file. You can see the code below(this all works fine):
example_test.py
Using inspiration from this answer to another SO question, I am using this approach to this problem which works well:
import pytest
@pytest.fixture(scope='session')
def requires_something(request):
something = 'a_thing'
if request.param != something:
pytest.skip(f"Test requires {request.param} but environment has {something}")
@pytest.mark.parametrize('requires_something',('something_else',), indirect=True)
def test_indirect(requires_something):
print("Executing test: test_indirect")