def METHOD_NAME(request, metadata):
    """Fixture to generate events.
    Execute the playbooks declared in the test to generate events.
    Args:
        request (fixture): Provide information on the executing test function.
        metadata (dict): Dictionary with test case metadata.
    """
    inventory_playbook = request.config.getoption('--inventory-path')
    roles_path = request.config.getoption('--roles-path')
    if not inventory_playbook:
        raise ValueError('Inventory not specified')
    # For each event generation playbook previously declared in the test, obtain the complete path and execute it.
    for playbook in getattr(request.module, 'events_playbooks'):
        events_playbook_path = os.path.join(getattr(request.module, 'test_data_path'), 'playbooks', playbook)
        parameters = {'playbook': events_playbook_path,
                      'inventory': inventory_playbook,
                      'envvars': {'ANSIBLE_ROLES_PATH': roles_path}}
        # Check if the test case has extra variables to pass to the playbook and add them to the parameters in that case
        if 'extra_vars' in metadata:
            parameters.update({'extravars': metadata['extra_vars']})
        ansible_runner.run(**parameters)