summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/parser.py2
-rw-r--r--tests/test_arcs.py17
2 files changed, 19 insertions, 0 deletions
diff --git a/coverage/parser.py b/coverage/parser.py
index f0d378c6..70be0230 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -611,6 +611,8 @@ class AstArcAnalyzer(object):
_line__FunctionDef = _line_decorated
+ _line__AsyncFunctionDef = _line_decorated
+
def _line__List(self, node):
if node.elts:
return self.line_for_node(node.elts[0])
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index bf17f712..a02e9f7d 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -1557,6 +1557,23 @@ class AsyncTest(CoverageTest):
arcz_missing=".2 23 3.",
)
+ def test_async_decorator(self):
+ if env.PYBEHAVIOR.trace_decorated_def:
+ arcz = ".1 14 45 5. .2 2. -46 6-4"
+ else:
+ arcz = ".1 14 4. .2 2. -46 6-4"
+ self.check_coverage("""\
+ def wrap(f): # 1
+ return f
+
+ @wrap # 4
+ async def go():
+ return
+ """,
+ arcz=arcz,
+ arcz_missing='-46 6-4',
+ )
+
class ExcludeTest(CoverageTest):
"""Tests of exclusions to indicate known partial branches."""