Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@thread.task(callback=callback)
def long_decorated_callback():
time.sleep(1)
def test_undecorated_results(self):
"""Thread Task undecorated results are produced."""
task = thread.task(target=undecorated, args=[1],
kwargs={'keyword_argument': 1})
self.assertEqual(task.get(), 2)
@thread.task(5, name='foo')
def wrong():
return
except Exception as error:
@thread.task
def instmethod(self):
return self.b
@thread.task
def error_decorated():
raise Exception("BOOM!")
@thread.task
def clsmethod(cls):
return cls.a
@thread.task
def long_decorated():
time.sleep(1)
@thread.task(callback=callback)
def decorated_callback(argument, keyword_argument=0):
"""A docstring."""
return argument + keyword_argument
@thread.task(callback=callback)
def error_decorated_callback():
raise Exception("BOOM!")