title: Locust.io setup, teardown not executed
body: <p>I'm trying to understand the flow within a locust test.  I've set up this very simple task set and user:</p>
  <pre class="lang-py prettyprint-override"><code>from locust import TaskSet, HttpLocust, task
  
  
  class BlazeDemoTaskSet(TaskSet):
  
      def setup(self):
          print(&quot;hello from taskset setup&quot;)
  
      def teardown(self):
          print(&quot;hello from taskset teardown&quot;)
  
      def on_start(self):
          print(&quot;hello from taskset on_start&quot;)
  
      def on_stop(self):
          print(&quot;hello from taskset on_stop&quot;)
  
      @task
      def reserve_task(self):
          post_response = self.client.post(
              url=&quot;/reserve.php&quot;,
              params={&quot;toPort&quot;: &quot;Buenos Aries&quot;, &quot;fromPort&quot;: &quot;Paris&quot;})
  
  
  class BlazeDemoUser(HttpLocust):
      task_set = BlazeDemoTaskSet
      min_wait = 500
      max_wait = 1500
      host = &quot;http://www.blazedemo.com&quot;
  
      def setup(self):
          print(&quot;hello from httplocust setup&quot;)
  
      def teardown(self):
          print(&quot;hello from httplocust teardown&quot;)
  
  </code></pre>
  <p>and I run it with:</p>
  <pre><code>locust -f tests/blazedemo.py --no-web -c 1 -r 1 -n 2
  </code></pre>
  <p>I'm not seeing the <code>HttpLocust</code> <code>setup</code> or <code>teardown</code> methods being executed, and I'm not seeing the <code>TaskSet</code> <code>setup</code>, <code>on_stop</code>, or <code>teardown</code> methods being executed.  The only methods that get run are <code>on_start</code> and <code>reserve_task</code></p>
  <p><a href="https://docs.locust.io/en/latest/writing-a-locustfile.html#setups-teardowns-on-start-and-on-stop" rel="nofollow noreferrer">According to the docs</a> all of these methods should be run.  Setup and teardown once per run, and on_start and on_stop for each user that is started.</p>
  <p>Here is the entire output from Locust:</p>
  <pre><code>[2018-03-22 18:26:50,698] C02PV7NSG8WP/INFO/locust.main: Starting Locust 0.8.1
  [2018-03-22 18:26:50,698] C02PV7NSG8WP/INFO/locust.runners: Hatching and swarming 1 clients at the rate 1 clients/s...
   Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
  --------------------------------------------------------------------------------------------------------------------------------------------
  --------------------------------------------------------------------------------------------------------------------------------------------
   Total                                                              0     0(0.00%)                                       0.00
  
  [2018-03-22 18:26:50,699] C02PV7NSG8WP/INFO/stdout: hello from taskset on_start
  [2018-03-22 18:26:50,699] C02PV7NSG8WP/INFO/stdout: 
  [2018-03-22 18:26:51,703] C02PV7NSG8WP/INFO/locust.runners: All locusts hatched: BlazeDemoUser: 1
  [2018-03-22 18:26:51,703] C02PV7NSG8WP/INFO/locust.runners: Resetting stats
  
   Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
  --------------------------------------------------------------------------------------------------------------------------------------------
   POST /reserve.php?toPort=Buenos+Aries&amp;fromPort=Paris               1     0(0.00%)     140     140     140  |     140    0.00
  --------------------------------------------------------------------------------------------------------------------------------------------
   Total                                                              1     0(0.00%)                                       0.00
  
  [2018-03-22 18:26:53,268] C02PV7NSG8WP/INFO/locust.runners: All locusts dead
  
  [2018-03-22 18:26:53,268] C02PV7NSG8WP/INFO/locust.main: Shutting down (exit code 0), bye.
   Name                                                          # reqs      # fails     Avg     Min     Max  |  Median   req/s
  --------------------------------------------------------------------------------------------------------------------------------------------
   POST /reserve.php?toPort=Buenos+Aries&amp;fromPort=Paris               2     0(0.00%)     139     139     140  |     140    0.00
  --------------------------------------------------------------------------------------------------------------------------------------------
   Total                                                              2     0(0.00%)                                       0.00
  
  Percentage of the requests completed within given times
   Name                                                           # reqs    50%    66%    75%    80%    90%    95%    98%    99%   100%
  --------------------------------------------------------------------------------------------------------------------------------------------
   POST /reserve.php?toPort=Buenos+Aries&amp;fromPort=Paris                2    140    140    140    140    140    140    140    140    140
  --------------------------------------------------------------------------------------------------------------------------------------------
  </code></pre>
  <p>What have I missed?  Thank you in advance!</p>