def METHOD_NAME(make_stubber, stub_runner, monkeypatch, error_code, stop_on_action):
    iam_resource = boto3.resource('iam')
    iam_stubber = make_stubber(iam_resource.meta.client)
    name_suffix = 'test'
    user_name = f'demo-user-{name_suffix}'
    role_name = f'demo-role-{name_suffix}'
    policy_name = f'demo-policy-{name_suffix}'
    user_policy_name = f'demo-user-policy-{name_suffix}'
    user_arn = f'arn:aws:iam:123456789012::user/{user_name}'
    role_arn = f'arn:aws:iam:123456789012::role/{role_name}'
    policy_arn = f'arn:aws:iam:123456789012::policy/{policy_name}'
    monkeypatch.setattr(assume_role, 'uuid4', lambda: name_suffix)
    monkeypatch.setattr(assume_role, 'progress_bar', lambda x: None)
    with stub_runner(error_code, stop_on_action) as runner:
        runner.add(iam_stubber.stub_create_user, user_name)
        runner.add(iam_stubber.stub_create_access_key, user_name)
        runner.add(iam_stubber.stub_get_user, user_name, user_arn)
        runner.add(iam_stubber.stub_create_role, role_name)
        runner.add(iam_stubber.stub_create_policy, policy_name, policy_arn)
        runner.add(iam_stubber.stub_attach_role_policy, role_name, policy_arn)
        runner.add(iam_stubber.stub_get_policy, policy_arn)
        runner.add(iam_stubber.stub_get_role, role_name, role_arn)
        runner.add(iam_stubber.stub_put_user_policy, user_name, user_policy_name)
    if error_code is None:
        user, user_key, role = assume_role.setup(iam_resource)
        assert user.name == user_name
        assert user_key.user_name == user_name
        assert role.name == role_name
    else:
        with pytest.raises(ClientError) as exc_info:
            assume_role.setup(iam_resource)
        assert exc_info.value.response['Error']['Code'] == error_code