summaryrefslogtreecommitdiff
path: root/tests/test_parser.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_parser.py
parentba3b00aea7ece98694766976095a46bcffc2e403 (diff)
downloadpython-coveragepy-git-2c60d618ccc611e0a901fd5825a4b5f8f8cc9042.tar.gz
Better branch-missed messages for lambdas.
Diffstat (limited to 'tests/test_parser.py')
-rw-r--r--tests/test_parser.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_parser.py b/tests/test_parser.py
index 0ede10b4..17f81ad8 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -329,6 +329,20 @@ class ParserMissingArcDescriptionTest(CoverageTest):
"because the return on line 12 wasn't executed"
)
+ def test_missing_arc_descriptions_bug460(self):
+ parser = self.parse_text(u"""\
+ x = 1
+ d = {
+ 3: lambda: [],
+ 4: lambda: [],
+ }
+ x = 6
+ """)
+ self.assertEqual(
+ parser.missing_arc_description(2, -3),
+ "line 3 didn't run the lambda on line 3",
+ )
+
class ParserFileTest(CoverageTest):
"""Tests for coverage.py's code parsing from files."""