How can I move the pytest.skip()
check outside so I can run it only once and not inside all tests like below.
I need the args.webhost
and args.tenant
from conftest.py
to run the check.
class TestClass:
@pytest.mark.parametrize("webhost", args.webhost)
@pytest.mark.parametrize("tenant", args.tenant)
def test01_setup(self, ext, params, tenant, webhost):
""" enroll user to use as passportreader """
providers = tools.scrape.portalproviders(webhost, type='operator', tenant=tenant)
if 'idp-passport-authenticator' not in providers:
pytest.skip(f"skip because idp-passport-authenticator not found for tenant:{tenant}")
:
@pytest.mark.parametrize("webhost", args.webhost)
@pytest.mark.parametrize("tenant", args.tenant)
def test02_passportreader(self, ext, params, tenant, webhost):
""" test enrolled user in passportreader frontend """
providers = tools.scrape.portalproviders(webhost, type='operator', tenant=tenant)
if 'idp-passport-authenticator' not in providers:
pytest.skip(f"skip because idp-passport-authenticator not found for tenant:{tenant}")
:
<more tests>
: