summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-08-11 08:19:58 -0400
committerNed Batchelder <ned@nedbatchelder.com>2011-08-11 08:19:58 -0400
commit9229a8acf7bae471f84a31ff1409800aceb74b72 (patch)
tree7c15eb9ae20d175d0672db6de56aefedb3adc286
parent669a609f88de252d41cd5b8510160c87ef6e65ba (diff)
parent7fb7094df42803bd1d0ca934a9f6e761d1a81da4 (diff)
downloadpython-coveragepy-git-9229a8acf7bae471f84a31ff1409800aceb74b72.tar.gz
Merge
-rw-r--r--CHANGES.txt3
-rw-r--r--test/test_arcs.py16
2 files changed, 19 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 8765dc16..7bef01f2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -8,6 +8,8 @@ Version 3.5.1
- for-else constructs are understood better, and don't cause erroneous partial
branch warnings. Fixes `issue 122`_.
+- Branch coverage for ``with`` statements is improved, fixing `issue 128`_.
+
- The number of partial branches reported on the HTML summary page was
different than the number reported on the individual file pages. This is
now fixed.
@@ -23,6 +25,7 @@ Version 3.5.1
See the fullcoverage directory if you are interested.
.. _issue 122: http://bitbucket.org/ned/coveragepy/issue/122/for-else-always-reports-missing-branch
+.. _issue 128: https://bitbucket.org/ned/coveragepy/issue/128/branch-coverage-of-with-statement-in-27
.. _issue 138: https://bitbucket.org/ned/coveragepy/issue/138/include-should-take-precedence-over-is
diff --git a/test/test_arcs.py b/test/test_arcs.py
index 2c983170..050961fa 100644
--- a/test/test_arcs.py
+++ b/test/test_arcs.py
@@ -143,6 +143,22 @@ class SimpleArcTest(CoverageTest):
)
+class WithTest(CoverageTest):
+ """Arc-measuring tests involving context managers."""
+
+ def test_with(self):
+ self.check_coverage("""\
+ def example():
+ with open("test", "w") as f: # exit
+ f.write("")
+ return 1
+
+ example()
+ """,
+ arcz=".1 .2 23 34 4. 16 6."
+ )
+
+
class LoopArcTest(CoverageTest):
"""Arc-measuring tests involving loops."""