From 7fb7094df42803bd1d0ca934a9f6e761d1a81da4 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 10 Aug 2011 08:03:45 -0400 Subject: The for-else fix also fixed 'with' statements, and therefore, issue #128. --- test/test_arcs.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') 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.""" -- cgit v1.2.1