title: How to get boto3 to use a local development SQS queue (and avoid the error `Could not connect to the endpoint URL`)
body: <p>We're using Boto3 to connect to an SQS queue. In testing/production this is fine, but for local development I'm using a version of <a href="https://github.com/iain/fake_sqs" rel="nofollow noreferrer">fake_sqs</a>.</p>
  
  <p>Rather than somehow fake real AWS endpoints (like overriding the hostname) I've opted to use a fake region (imaginatively called <code>test</code>)</p>
  
  <p>Other parts of our code use the earlier boto library (as opposed to Boto3). With this it's possible to override the region's endpoint host names by specifying an environment variable named <code>BOTO_ENDPOINTS</code>. This contains a path to a file that contains Boto config for regions. For local testing, it contains just one</p>
  
  <p><code>{
    "sqs": {
      "test": "fake_sqs"
    }
  }</code></p>
  
  <p>Boto3, however, ignores such an envvar. It loads the  <code>data/endpoints.json</code> file stored in the <code>botocore</code> package and, when connecting to our fake region, we get the error <code>EndpointConnectionError: Could not connect to the endpoint URL: "https://test.queue.amazonaws.com/"</code>. </p>
  
  <p>The codebase we've inherited has embedded the configuration of the queues pretty deep, so we can't simply tell the connection to use a specific endpoint (like <a href="https://stackoverflow.com/questions/32618216/overwrite-s3-endpoint-using-boto3-configuration-file">this thread suggests</a>).</p>
  
  <p>So, does anyone know of a way to get Boto3 to use a different hostname without changing the code that we have to setup the SQS connection?</p>