@pytest.fixture
def create_group(api, account):
    'Create new group in account.\n\n    :param api: api fixture\n    :param account: account fixture\n    :yields: create_group function\n    '
    groups = []
    group_counter = 0

    def _create_group(name: Optional[str]=None):
        nonlocal group_counter
        group_counter += 1
        if (name is None):
            name = 'SDK_TEST_GROUP_{gnum}'.format(gnum=group_counter)
        account_id = account.account.uuid
        response = api.Group.add(account_id=account_id, name=name).get()
        group = GroupParams(uuid=response.uuid, namespace_id=response.namespace_id, name=name)
        groups.append(group)
        api.Group.user_add(uuid=group.uuid, user_id=account.user.uuid).get()
        return group
    (yield _create_group)
    for group in groups:
        api.Group.delete(uuid=group.uuid).get()
Create new group in account.

:param api: api fixture
:param account: account fixture
:yields: create_group function
@pytest.fixture
def create_group(api, account):
    'Create new group in account.\n\n    :param api: api fixture\n    :param account: account fixture\n    :yields: create_group function\n    '
    groups = []
    group_counter = 0

    def _create_group(name: Optional[str]=None):
        nonlocal group_counter
        group_counter += 1
        if (name is None):
            name = 'SDK_TEST_GROUP_{gnum}'.format(gnum=group_counter)
        account_id = account.account.uuid
        response = api.Group.add(account_id=account_id, name=name).get()
        group = GroupParams(uuid=response.uuid, namespace_id=response.namespace_id, name=name)
        groups.append(group)
        api.Group.user_add(uuid=group.uuid, user_id=account.user.uuid).get()
        return group
    (yield _create_group)
    for group in groups:
        api.Group.delete(uuid=group.uuid).get()