Skip to content

Commit 2408573

Browse files
committed
Python: Add API graph test for calling coroutines
1 parent 7a5fd02 commit 2408573

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import pkg # $ use=moduleImport("pkg")
2+
3+
async def foo():
4+
coro = pkg.async_func() # $ use=moduleImport("pkg").getMember("async_func").getReturn()
5+
coro # $ use=moduleImport("pkg").getMember("async_func").getReturn()
6+
result = await coro # $ use=moduleImport("pkg").getMember("async_func").getReturn()
7+
result # $ MISSING: use=...
8+
return result # $ MISSING: use=...
9+
10+
async def bar():
11+
result = await pkg.async_func() # $ use=moduleImport("pkg").getMember("async_func").getReturn()
12+
return result # $ MISSING: use=...
13+
14+
def check_annotations():
15+
# Just to make sure how annotations should look like :)
16+
result = pkg.sync_func() # $ use=moduleImport("pkg").getMember("sync_func").getReturn()
17+
return result # $ use=moduleImport("pkg").getMember("sync_func").getReturn()

0 commit comments

Comments
 (0)