title: TypeError: decorator() missing 1 required positional argument: 'func'
body: <p><a href="https://i.stack.imgur.com/JWGIw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JWGIw.png" alt="enter image description here"></a></p>
  
  <p>I'm trying to use python huey (<a href="https://github.com/coleifer/huey/blob/master/huey/api.py" rel="nofollow noreferrer">https://github.com/coleifer/huey/blob/master/huey/api.py</a>) to allow usage of a task queue with flask. </p>
  
  <p>Starting with a function:</p>
  
  <pre><code>def some_long_calculation():
      driver = create_chromedriver(True)
      print(driver.capabilities['version'])
      driver.get("https://www.yahoo.com/news/")
  </code></pre>
  
  <p>I import it into the tasks.py file and turn into into a task function with:</p>
  
  <pre><code>from . import my_huey
  some_long_calculation_task = my_huey.task(some_long_calculation)
  </code></pre>
  
  <p>I then import some_long_calculation_task  into main/views.py and try to run it with:</p>
  
  <pre><code>@main.route('/sanity_check')
  def sanity_check():
      png = some_long_calculation_task()
      return send_file(io.BytesIO(png),mimetype='image/png')
  </code></pre>
  
  <p>but I get:</p>
  
  <pre><code>traceback (most recent call last):
    File "...lib\site-packages\flask\app.py", line 1994, in __call__
      return self.wsgi_app(environ, start_response)
    File "...lib\site-packages\flask\app.py", line 1985, in wsgi_app
      response = self.handle_exception(e)
    File "...lib\site-packages\flask\app.py", line 1540, in handle_exception
      reraise(exc_type, exc_value, tb)
    File "...lib\site-packages\flask\_compat.py", line 33, in reraise
      raise value
    File "...lib\site-packages\flask\app.py", line 1982, in wsgi_app
      response = self.full_dispatch_request()
    File "...lib\site-packages\flask\app.py", line 1614, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File "...lib\site-packages\flask\app.py", line 1517, in handle_user_exception
      reraise(exc_type, exc_value, tb)
    File "...lib\site-packages\flask\_compat.py", line 33, in reraise
      raise value
    File "...lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
      rv = self.dispatch_request()
    File "...lib\site-packages\flask\app.py", line 1598, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
    File "...app\main\views.py", line 123, in sanity_check
      png = some_long_calculation_task()
  TypeError: decorator() missing 1 required positional argument: 'func'
  
  &gt;&gt;&gt; some_long_calculation_task
  &lt;function Huey.task.&lt;locals&gt;.decorator at 0x0000028CF8CF2BF8&gt;
  </code></pre>
  
  <p>How can I fix this?</p>