def pytest_generate_tests()

in pytest_rally/plugin.py [0:0]


def pytest_generate_tests(metafunc):
    repo = metafunc.config.getoption('track_repository')
    rev = metafunc.config.getoption('track_revision')
    current_class = metafunc.cls
    desired_class = metafunc.config.option.test_class

    if current_class is not None and current_class.__name__ == desired_class:
        if "track" and "challenge" in metafunc.fixturenames:
            r = metafunc.config.option.rally
            params = []
            tracks_and_challenges = r.all_tracks_and_challenges()
            for track, challenges in tracks_and_challenges:
                params += [(default_params(track, challenge)) for challenge in challenges]
            metafunc.parametrize("track,challenge,rally_options", params)
            metafunc.definition.parent.add_marker("autogenerated")