cfme.markers.env_markers.provider module

class cfme.markers.env_markers.provider.ProviderEnvironmentMarker[source]

Bases: cfme.markers.env.EnvironmentMarker

NAME = 'provider'
cfme.markers.env_markers.provider.parametrize(metafunc, argnames, argvalues, *args, **kwargs)[source]

parametrize wrapper that calls _param_check(), and only parametrizes when needed

This can be used in any place where conditional parametrization is used.

cfme.markers.env_markers.provider.providers(metafunc, filters=None, selector='all')[source]

Gets providers based on given (+ global) filters


Using the default ‘function’ scope, each test will be run individually for each provider before moving on to the next test. To group all tests related to single provider together, parametrize tests in the ‘module’ scope.


testgen for providers now requires the usage of test_flags for collection to work. Please visit for more details.

cfme.markers.env_markers.provider.providers_by_class(metafunc, classes, required_fields=None, selector='all')[source]

Gets providers by their class

  • metafunc – Passed in by pytest
  • classes – List of classes to fetch
  • required_fields – See cfme.utils.provider.ProviderFilter


# In the function itself
def pytest_generate_tests(metafunc):
    argnames, argvalues, idlist = testgen.providers_by_class(
        [GCEProvider, AzureProvider], required_fields=['provisioning']
metafunc.parametrize(argnames, argvalues, ids=idlist, scope='module')

# Using the parametrize wrapper
pytest_generate_tests = testgen.parametrize([GCEProvider], scope='module')