def METHOD_NAME(self, region, yaml, error, set_env, unset_env):
    expected = "eu-west-1"
    if error:
        with pytest.raises(BadRequestException) as e:
            configure_aws_region_from_config(region, yaml)
        assert_that(str(e.value.content)).contains(error)
    else:
        configure_aws_region_from_config(region, yaml)
        assert_that(os.environ["AWS_DEFAULT_REGION"]).is_equal_to(expected)