summaryrefslogtreecommitdiff
path: root/test/test_arcs.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_arcs.py')
-rw-r--r--test/test_arcs.py16
1 files changed, 16 insertions, 0 deletions
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."""