コード例 #1
0
def pytest_generate_tests(metafunc):
    data = load_cfme_data(metafunc.config.option.cfme_data_filename)
    argnames = []
    tests = []

    if 'pwr_ctl_vms' in metafunc.fixturenames:
        argnames = ['pwr_ctl_vms', 'provider', 'vm_name']
        metafunc.parametrize(argnames, fetch_list(data), scope="module")
    elif 'random_pwr_ctl_vm' in metafunc.fixturenames:
        argnames = ['random_pwr_ctl_vm', 'provider', 'vm_name']
        all_tests = fetch_list(data)
        if all_tests:
            tests.append(random.choice(all_tests))
        metafunc.parametrize(argnames, tests, scope="module")
コード例 #2
0
def pytest_generate_tests(metafunc):
    data = load_cfme_data(metafunc.config.option.cfme_data_filename)
    argnames = []
    tests = []

    if 'pwr_ctl_vms' in metafunc.fixturenames:
        argnames = ['pwr_ctl_vms', 'provider', 'vm_name']
        metafunc.parametrize(argnames, fetch_list(data), scope="module")
    elif 'random_pwr_ctl_vm' in metafunc.fixturenames:
        argnames = ['random_pwr_ctl_vm', 'provider', 'vm_name']
        all_tests = fetch_list(data)
        if all_tests:
            tests.append(random.choice(all_tests))
        metafunc.parametrize(argnames, tests, scope="module")
コード例 #3
0
ファイル: cfme_data.py プロジェクト: jwadkins/cfme_tests
def pytest_runtest_setup(item):
    # If cfme_data_filename is None, it will be autoloaded
    CfmeSetup.data = load_cfme_data(item.config.option.cfme_data_filename)
コード例 #4
0
ファイル: cfme_data.py プロジェクト: aweiteka/cfme_tests
def pytest_runtest_setup(item):
    # If cfme_data_filename is None, it will be autoloaded
    CfmeSetup.data = load_cfme_data(item.config.option.cfme_data_filename)