diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-08-11 08:31:29 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-08-11 08:31:29 -0400 |
commit | 8e1e857632f8fc9c49c3aaada3b0ae0630fa4fbd (patch) | |
tree | 3adbe7f2fab336c2c21755c37c8fa3ed6935d8dc /test/test_arcs.py | |
parent | 9229a8acf7bae471f84a31ff1409800aceb74b72 (diff) | |
download | python-coveragepy-git-8e1e857632f8fc9c49c3aaada3b0ae0630fa4fbd.tar.gz |
Oh, can't test 'with' in Pythons that don't have it.
Diffstat (limited to 'test/test_arcs.py')
-rw-r--r-- | test/test_arcs.py | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/test/test_arcs.py b/test/test_arcs.py index 050961fa..937c2e79 100644 --- a/test/test_arcs.py +++ b/test/test_arcs.py @@ -143,20 +143,21 @@ class SimpleArcTest(CoverageTest): ) -class WithTest(CoverageTest): - """Arc-measuring tests involving context managers.""" +if sys.version_info >= (2, 6): + 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." - ) + 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): |