summaryrefslogtreecommitdiff
path: root/tests/test_arcs.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-02-25 08:38:20 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-02-25 08:38:20 -0500
commit2c60d618ccc611e0a901fd5825a4b5f8f8cc9042 (patch)
tree8209863512194d91279b1dec58aefb7eb26adf8a /tests/test_arcs.py
parentba3b00aea7ece98694766976095a46bcffc2e403 (diff)
downloadpython-coveragepy-git-2c60d618ccc611e0a901fd5825a4b5f8f8cc9042.tar.gz
Better branch-missed messages for lambdas.
Diffstat (limited to 'tests/test_arcs.py')
-rw-r--r--tests/test_arcs.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index dd7e9b37..d18faf74 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -1246,6 +1246,26 @@ class LambdaArcTest(CoverageTest):
arcz_unpredicted="58",
)
+ def test_lambda_in_dict(self):
+ self.check_coverage("""\
+ x = 1
+ x = 2
+ d = {
+ 4: lambda: [],
+ 5: lambda: [],
+ 6: lambda: [],
+ 7: lambda: [],
+ }
+
+ for k, v in d.items(): # 10
+ if k & 1:
+ v()
+ """,
+ arcz=".1 12 23 3A AB BC BA CA A. .3 3-4 3-5 3-6 3-7",
+ arcz_missing="3-4 3-6",
+ arcz_unpredicted="",
+ )
+
class AsyncTest(CoverageTest):
"""Tests of the new async and await keywords in Python 3.5"""