summaryrefslogtreecommitdiff
path: root/tests/test_arcs.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-01-18 19:24:50 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-01-18 19:24:50 -0500
commit95c9930f5c936571f32b873c6a9110204a2404ec (patch)
tree1b0e8147b483c03008ec87977ffb3ba8a3e7b342 /tests/test_arcs.py
parentc67e5b03f367654f3cb9c130a87dbe1df3e618af (diff)
downloadpython-coveragepy-95c9930f5c936571f32b873c6a9110204a2404ec.tar.gz
Fix #466: multi-line statements first in decorated functions
Also, leave in the SetSpy tracer we've used before to find things like this.
Diffstat (limited to 'tests/test_arcs.py')
-rw-r--r--tests/test_arcs.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index 04dbd15..5c0d1e5 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -1108,6 +1108,38 @@ class DecoratorArcTest(CoverageTest):
".6 D-6 ", # MyObject
)
+ def test_bug_466(self):
+ # A bad interaction between decorators and multi-line list assignments,
+ # believe it or not...!
+ self.check_coverage("""\
+ class Parser(object):
+
+ @classmethod
+ def parse(cls):
+ formats = [ 5 ]
+
+
+ return None
+
+ Parser.parse()
+ """,
+ arcz=".1 1A A. 13 3. .5 58 8-3",
+ )
+ self.check_coverage("""\
+ class Parser(object):
+
+ @classmethod
+ def parse(cls):
+ formats = [
+ 6,
+ ]
+ return None
+
+ Parser.parse()
+ """,
+ arcz=".1 1A A. 13 3. .5 58 8-3",
+ )
+
class LambdaArcTest(CoverageTest):
"""Tests of lambdas"""