title: Force a ungraceful disconnect in MQTT (to trigger a last-will message)
body: <p>In testing, I'd like to test some last-will behaviour between my Python MQTT client and broker (mosquitto). Both are on the same machine. How can I simulate / force a disconnect within Python between the client and broker?</p>
  <p>Ideally, my Python script looks something like:</p>
  <pre class="lang-py prettyprint-override"><code>client = Client(&quot;localhost&quot;)
  client.will_set(**last_will)
  client.connect()
  
  # force a disconnect here? 
  # listen for the last will
  # allow connection again
  
  # at this point, client should have reconnected and I can continue
  ...
  client.subscribe(...)
  ...
  
  </code></pre>