@@ -31,8 +31,7 @@ def test_basic_call_coroutine():
3131 """The most basic Happy-Path test for Hug APIs using async"""
3232
3333 @hug .call ()
34- @asyncio .coroutine
35- def hello_world ():
34+ async def hello_world ():
3635 return "Hello World!"
3736
3837 assert loop .run_until_complete (hello_world ()) == "Hello World!"
@@ -42,25 +41,22 @@ def test_nested_basic_call_coroutine():
4241 """The most basic Happy-Path test for Hug APIs using async"""
4342
4443 @hug .call ()
45- @asyncio .coroutine
46- def hello_world ():
44+ async def hello_world ():
4745 return getattr (asyncio , "ensure_future" )(nested_hello_world ())
4846
4947 @hug .local ()
50- @asyncio .coroutine
51- def nested_hello_world ():
48+ async def nested_hello_world ():
5249 return "Hello World!"
5350
54- assert loop .run_until_complete (hello_world ()) == "Hello World!"
51+ assert loop .run_until_complete (hello_world ()). result () == "Hello World!"
5552
5653
5754def test_basic_call_on_method_coroutine ():
5855 """Test to ensure the most basic call still works if applied to a method"""
5956
6057 class API (object ):
6158 @hug .call ()
62- @asyncio .coroutine
63- def hello_world (self = None ):
59+ async def hello_world (self = None ):
6460 return "Hello World!"
6561
6662 api_instance = API ()
@@ -79,8 +75,7 @@ def hello_world(self):
7975 api_instance = API ()
8076
8177 @hug .call ()
82- @asyncio .coroutine
83- def hello_world ():
78+ async def hello_world ():
8479 return api_instance .hello_world ()
8580
8681 assert api_instance .hello_world () == "Hello World!"
@@ -94,8 +89,7 @@ class API(object):
9489 def __init__ (self ):
9590 hug .call ()(self .hello_world_method )
9691
97- @asyncio .coroutine
98- def hello_world_method (self ):
92+ async def hello_world_method (self ):
9993 return "Hello World!"
10094
10195 api_instance = API ()
0 commit comments