title: Locust, on_start method doesn't work with tasks
body: <p>I am trying to add some variables (e.g. self.boolean_flag) to HttpUser.
  Which represents the user state. This variable is used in scenario load testing.</p>
  <p>According to the documentation, I should use <em>on_start</em> to initialise variables.
  However, when I use tasks = [TaskSet] like below, The on_start doesn't seem to work.</p>
  <p>AttributeError: 'ExampleTask' object has no attribute 'boolean_flag':</p>
  <pre><code>class ExampleTask(TaskSet):
      @task
      def example_one(self):
          print(self.boolean_flag)   # AttributeError: 'ExampleTask' object has no attribute 'boolean_flag'
          make_api_request(self, &quot;example_one&quot;)
  
  
  class CustomUser(HttpUser):
      wait_time = between(
          int(os.getenv(&quot;LOCUST_MIN_WAIT&quot;, 200)), int(os.getenv(&quot;LOCUST_MAX_WAIT&quot;, 1000))
      )
  
      def on_start(self):
          self.boolean_flag = False
  
      tasks = {ExampleTask1 : 10, ExampleTask2: 5 ... }
  
  </code></pre>
  <p>The bottom works though:</p>
  <pre><code>class CustomUser(HttpUser):
      wait_time = between(
          int(os.getenv(&quot;LOCUST_MIN_WAIT&quot;, 200)), int(os.getenv(&quot;LOCUST_MAX_WAIT&quot;, 1000))
      )
  
      def on_start(self):
          self.boolean_flag = False
  
      @task
      def example_one(self):
          print(self.boolean_flag)
          make_api_request(self, &quot;example_one&quot;)
  
  </code></pre>
  <p>Since I have many different scenarios that reuse many Tasksets, I need to use Tasks = {}..</p>
  <p>I also tried subclassing HttpUser and add those variables in <strong>init</strong>().
  But that doesn't work well with tasks={} either.</p>
  <pre><code>class CustomUser(HttpUser):
      def __init__(self, *args, **kwargs):
          super().__init__(*args, **kwargs)
          self.boolean_flag = False
  
  
  class AllOfApisCallForLoadAtOneGo(CustomUser):
      wait_time = between(
      int(os.getenv(&quot;LOCUST_MIN_WAIT&quot;, 200)), int(os.getenv(&quot;LOCUST_MAX_WAIT&quot;, 1000))
  )
      tasks = {ExampleTask1 : 10, ExampleTask2: 5 ... }
  </code></pre>
  <pre><code>(loadtest-GvbsrA_X-py3.8) ➜  loadtest git:(abcd) ✗ locust -f locustfile_scenario.py first -H https://www.somehost.com
  [2020-09-02 06:24:27,276] MacBook-Pro.local/INFO/locust.main: Starting web interface at http://0.0.0.0:8089 (accepting connections from all network interfaces)
  [2020-09-02 06:24:27,286] MacBook-Pro.local/INFO/locust.main: Starting Locust 1.2.3
  [2020-09-02 06:24:35,881] MacBook-Pro.local/INFO/locust.runners: Spawning 10 users at the rate 3 users/s (0 users already running)...
  [2020-09-02 06:24:35,883] MacBook-Pro.local/ERROR/locust.user.task: You must specify the base host. Either in the host attribute in the User class, or on the command line using the --host option.
  Traceback (most recent call last):
    File &quot;/Users/poetry/virtualenvs/loadtest-GvbsrA_X-py3.8/lib/python3.8/site-packages/locust/user/task.py&quot;, line 284, in run
      self.execute_next_task()
    File &quot;/Users/poetry/virtualenvs/loadtest-GvbsrA_X-py3.8/lib/python3.8/site-packages/locust/user/task.py&quot;, line 309, in execute_next_task
      self.execute_task(self._task_queue.pop(0))
    File &quot;/Users/poetry/virtualenvs/loadtest-GvbsrA_X-py3.8/lib/python3.8/site-packages/locust/user/task.py&quot;, line 422, in execute_task
      task(self.user)
    File &quot;/Users/poetry/virtualenvs/loadtest-GvbsrA_X-py3.8/lib/python3.8/site-packages/locust/user/users.py&quot;, line 224, in __init__
      raise LocustError(
  locust.exception.LocustError: You must specify the base host. Either in the host attribute in the User class, or on the command line using the --host option.
  </code></pre>