diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-08-10 08:03:45 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-08-10 08:03:45 -0400 |
commit | fd70e78bae72dd09d35ec305e75d9e5fb4a416c5 (patch) | |
tree | 09988fe0a5f62bb611fbe6ae6a91ab4c517cec32 /test/test_arcs.py | |
parent | 1966f545699490822117d66a86f2de91734a6ee9 (diff) | |
download | python-coveragepy-fd70e78bae72dd09d35ec305e75d9e5fb4a416c5.tar.gz |
The for-else fix also fixed 'with' statements, and therefore, issue #128.
Diffstat (limited to 'test/test_arcs.py')
-rw-r--r-- | test/test_arcs.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_arcs.py b/test/test_arcs.py index 2c98317..050961f 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.""" |