summaryrefslogtreecommitdiff
path: root/tests/test_arcs.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-01-02 10:18:04 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-01-02 10:18:04 -0500
commit6eb046c5937b9c78dab3451fae9348c4c721d6f9 (patch)
tree5afec4ac88a7571375de71789d463fd3d8452c21 /tests/test_arcs.py
parentd7cae8f7aeafd87a1e665b60035ac173c5de2187 (diff)
downloadpython-coveragepy-git-6eb046c5937b9c78dab3451fae9348c4c721d6f9.tar.gz
Handle yield-from and await. All tests pass
--HG-- branch : ast-branch
Diffstat (limited to 'tests/test_arcs.py')
-rw-r--r--tests/test_arcs.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index 303b10e6..6ba663bc 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -867,23 +867,25 @@ class AsyncTest(CoverageTest):
self.check_coverage("""\
import asyncio
- async def compute(x, y):
+ async def compute(x, y): # 3
print("Compute %s + %s ..." % (x, y))
await asyncio.sleep(0.001)
- return x + y
+ return x + y # 6
- async def print_sum(x, y):
- result = await compute(x, y)
+ async def print_sum(x, y): # 8
+ result = (0 +
+ await compute(x, y) # A
+ )
print("%s + %s = %s" % (x, y, result))
- loop = asyncio.get_event_loop()
+ loop = asyncio.get_event_loop() # E
loop.run_until_complete(print_sum(1, 2))
- loop.close()
+ loop.close() # G
""",
arcz=
- ".1 13 38 8C CD DE E. "
- ".4 45 56 6-3 "
- ".9 9A A-8",
+ ".1 13 38 8E EF FG G. "
+ ".4 45 56 5-3 6-3 "
+ ".9 9-8 9C C-8",
)
self.assertEqual(self.stdout(), "Compute 1 + 2 ...\n1 + 2 = 3\n")